Browse Source

Moved all ignored tests for the C# back-end to a temporary test project and enabled them.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/61/head
Dimitar Dobrev 12 years ago
parent
commit
cf58c70d23
  1. 7
      tests/Basic/Basic.Tests.cs
  2. 4
      tests/Basic/Basic.h
  3. 21
      tests/CSharpTemp/CSharpTemp.Tests.cs
  4. 12
      tests/CSharpTemp/CSharpTemp.cpp
  5. 22
      tests/CSharpTemp/CSharpTemp.cs
  6. 15
      tests/CSharpTemp/CSharpTemp.h
  7. 2
      tests/CSharpTemp/premake4.lua

7
tests/Basic/Basic.Tests.cs

@ -117,13 +117,6 @@ public class BasicTests @@ -117,13 +117,6 @@ public class BasicTests
Assert.AreEqual(abstractFoo.pureFunction2(), 15);
}
[Test, Ignore]
public void TestPropertyAccessModifier()
{
Assert.That(typeof(Foo2).GetProperty("P",
BindingFlags.Instance | BindingFlags.NonPublic), Is.Not.Null);
}
[Test]
public void TestANSI()
{

4
tests/Basic/Basic.h

@ -29,10 +29,6 @@ public: @@ -29,10 +29,6 @@ public:
Foo2 operator<<(signed int i);
Foo2 operator<<(signed long l);
// TODO: uncomment when the C++/CLI back-end supports protected members
//protected:
// int P;
};
struct DLL_API Bar

21
tests/CSharpTemp/CSharpTemp.Tests.cs

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
using System.Reflection;
using NUnit.Framework;
using Foo = CSharpTemp.Foo;
[TestFixture]
public class CSharpTempTests
{
[Test]
public void TestIndexer()
{
var foo = new Foo();
Assert.That(foo[0], Is.EqualTo(5));
}
[Test]
public void TestPropertyAccessModifier()
{
Assert.That(typeof(Foo).GetProperty("P",
BindingFlags.Instance | BindingFlags.NonPublic), Is.Not.Null);
}
}

12
tests/CSharpTemp/CSharpTemp.cpp

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
#include "CSharpTemp.h"
// TODO: move this, it has nothing to do with Unicode, it's here only not to break the CLI branch
int Foo::operator[](int i) const
{
return 5;
}
int Foo::operator[](int i)
{
return 5;
}

22
tests/CSharpTemp/CSharpTemp.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
using CppSharp.Generators;
using CppSharp.Utils;
namespace CppSharp.Tests
{
public class CSharpTempTests : LibraryTest
{
public CSharpTempTests(LanguageGeneratorKind kind)
: base("CSharpTemp", kind)
{
}
static class Program
{
public static void Main(string[] args)
{
ConsoleDriver.Run(new CSharpTempTests(LanguageGeneratorKind.CSharp));
}
}
}
}

15
tests/CSharpTemp/CSharpTemp.h

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
#if defined(_MSC_VER)
#define DLL_API __declspec(dllexport)
#else
#define DLL_API
#endif
class DLL_API Foo
{
public:
int operator[](int i) const;
int operator[](int i);
protected:
int P;
};

2
tests/CSharpTemp/premake4.lua

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
group "Tests/CSharpTemp"
SetupTestCSharp("CSharpTemp")
Loading…
Cancel
Save