Skip to content

Commit

Permalink
an attempt to make a test case for sqlite3_config_log sufficiently co…
Browse files Browse the repository at this point in the history
…mplicated to serve as a repro for #516.  no luck.  calling sqlite3_log() multiple times still seems to work, even when disabling the CallingConvention fix.
  • Loading branch information
ericsink committed Sep 16, 2022
1 parent 9adcbfc commit b166926
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Copyright>Copyright 2014-2022 SourceGear, LLC</Copyright>
<Company>SourceGear</Company>
<Authors>Eric Sink</Authors>
<Version>2.1.2-pre20220916104546</Version>
<Version>2.1.2-pre20220916160911</Version>
<AssemblyVersion>2.1.2.1719</AssemblyVersion>
<FileVersion>2.1.2.1719</FileVersion>
<Description>SQLitePCLRaw is a Portable Class Library (PCL) for low-level (raw) access to SQLite</Description>
Expand Down
25 changes: 22 additions & 3 deletions src/common/tests_xunit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2862,10 +2862,29 @@ public void test_log()

GC.Collect();

const string VAL = "hello!";
raw.sqlite3_log(0, VAL);
const string VAL0 = "hello!";
raw.sqlite3_log(0, VAL0);
Assert.Single(msgs);
Assert.Equal(VAL, msgs[0]);
Assert.Equal(VAL0, msgs[0]);

const string VAL1 = "world!";
raw.sqlite3_log(0, VAL1);
Assert.Equal(2, msgs.Count);
Assert.Equal(VAL0, msgs[0]);
Assert.Equal(VAL1, msgs[1]);

const int MORE = 17;
for (var i = 0; i < MORE; i++)
{
Assert.Equal(2 + i, msgs.Count);
raw.sqlite3_log(0, $"{i}");
Assert.Equal(2 + i + 1, msgs.Count);
}

for (var i = 0; i < MORE; i++)
{
Assert.Equal($"{i}", msgs[i + 2]);
}

strdelegate_log no_cb = null;
rc = raw.sqlite3_config_log(no_cb, null);
Expand Down

1 comment on commit b166926

@ericsink
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message references the wrong issue number -- should be #506

Please sign in to comment.