void TestScope() { var b = new CSharpB(); { TestInnerScope(b); ClearGC(); Assert.AreEqual( "C++ Call A:C# Hell!", b.CallA() ); } ClearGC(); Assert.AreEqual( "C++ Call A:C# Hell!", b.CallA() ); // How to keep shared_ptr passed object as long as C++ needs it? }
void TestScope() { var b = new CSharpB(); { TestInnerScope(b); ClearGC(); Assert.AreEqual("C++ Call A:C# Hell!", b.CallA()); } ClearGC(); Assert.AreEqual("C++ Call A:C# Hell!", b.CallA()); // How to keep shared_ptr passed object as long as C++ needs it? }
public void TestInheritedFunctionCallFromCpp() { var a = new CSharpA(); var b = new CSharpB(); a.SetName( "bob" ); a.SayHello(); b.SetA( a ); Assert.AreEqual( "C++ Call A:C# Hell!", b.CallA() ); }
public void TestInheritedFunctionCallFromCpp() { var a = new CSharpA(); var b = new CSharpB(); a.SetName("bob"); a.SayHello(); b.SetA(a); Assert.AreEqual("C++ Call A:C# Hell!", b.CallA()); }
public void TestWithUsing() { using ( var a = new CSharpAwithDestructor() ) { using ( var b = new CSharpB() ) { a.SetName( "rar" ); b.SetA( a ); Assert.AreEqual( "C++ Call A:C# Hell!", b.CallA() ); } } ClearGC(); Assert.AreEqual( CSharpAwithDestructor.State.Destroyed, CSharpAwithDestructor.LastState ); }
public void TestWithUsing() { using (var a = new CSharpAwithDestructor()) { using (var b = new CSharpB()) { a.SetName("rar"); b.SetA(a); Assert.AreEqual("C++ Call A:C# Hell!", b.CallA()); } } ClearGC(); Assert.AreEqual(CSharpAwithDestructor.State.Destroyed, CSharpAwithDestructor.LastState); }