Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Incref/Decref bugfix.
  • Loading branch information
dse committed Sep 5, 2017
commit 296d8ba3a77abddfa64f6edb1651af7b5a73d2f5
1 change: 1 addition & 0 deletions src/embed_tests/TestPyAnsiString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void TestCtorPtr()
const string expected = "foo";

var t = new PyAnsiString(expected);
Runtime.Runtime.XIncref(t.Handle);
var actual = new PyAnsiString(t.Handle);

Assert.AreEqual(expected, actual.ToString());
Expand Down
1 change: 1 addition & 0 deletions src/embed_tests/TestPyLong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void TestCtorDouble()
public void TestCtorPtr()
{
var i = new PyLong(5);
Runtime.Runtime.XIncref(i.Handle);
var a = new PyLong(i.Handle);
Assert.AreEqual(5, a.ToInt32());
}
Expand Down
1 change: 1 addition & 0 deletions src/embed_tests/TestPyString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void TestCtorPtr()
const string expected = "foo";

var t = new PyString(expected);
Runtime.Runtime.XIncref(t.Handle);
var actual = new PyString(t.Handle);

Assert.AreEqual(expected, actual.ToString());
Expand Down