Browse Source

Prevented a crash in the tests on Mono because of a Mono bug.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/520/head
Dimitar Dobrev 10 years ago
parent
commit
bbcf12550f
  1. 2
      src/Core/Platform.cs
  2. 2
      src/Generator.Tests/GeneratorTest.cs
  3. 5
      tests/CSharpTemp/CSharpTemp.Tests.cs

2
src/Core/Platform.cs

@ -50,7 +50,7 @@ namespace CppSharp @@ -50,7 +50,7 @@ namespace CppSharp
public static bool IsMono
{
get { return System.Type.GetType("Mono.Runtime") == null; }
get { return Type.GetType("Mono.Runtime") != null; }
}
}
}

2
src/Generator.Tests/GeneratorTest.cs

@ -39,7 +39,7 @@ namespace CppSharp.Utils @@ -39,7 +39,7 @@ namespace CppSharp.Utils
// Workaround for CLR which does not check for .dll if the
// name already has a dot.
if (Platform.IsMono)
if (!Platform.IsMono)
options.SharedLibraryName += ".dll";
var path = Path.GetFullPath(GetTestsDirectory(name));

5
tests/CSharpTemp/CSharpTemp.Tests.cs

@ -60,6 +60,11 @@ public class CSharpTempTests : GeneratorTestFixture @@ -60,6 +60,11 @@ public class CSharpTempTests : GeneratorTestFixture
[Test]
public void TestMultipleInheritance()
{
// TODO: remove when the bug in question is fixed
if (Type.GetType("Mono.Runtime") != null)
{
Assert.Fail("Crashes with Mono because of a problem with marshalling arrays: https://gist.github.com/tritao/7e62c71ffe57d6bc326e");
}
using (var baz = new Baz())
{
Assert.That(baz.Method, Is.EqualTo(1));

Loading…
Cancel
Save