Browse Source

Fixed the remaining tests from the pull request.

pull/219/merge
triton 12 years ago
parent
commit
46f92e30d0
  1. 9
      tests/Basic/Basic.Tests.cs
  2. 14
      tests/Basic/Basic.h

9
tests/Basic/Basic.Tests.cs

@ -225,5 +225,14 @@ public class BasicTests : GeneratorTestFixture @@ -225,5 +225,14 @@ public class BasicTests : GeneratorTestFixture
var someStruct = new SomeStruct();
Assert.That(someStruct[0], Is.EqualTo(1));
}
[Test]
public unsafe void TestOperators()
{
var @class = new ClassWithOverloadedOperators();
Assert.AreEqual(1, (char) @class);
Assert.AreEqual(2, (int)@class);
Assert.AreEqual(3, (short)@class);
}
}

14
tests/Basic/Basic.h

@ -304,7 +304,7 @@ struct EmptyNamedNestedEnum @@ -304,7 +304,7 @@ struct EmptyNamedNestedEnum
};
typedef unsigned long foo_t;
typedef DLL_API struct SomeStruct
typedef struct DLL_API SomeStruct
{
SomeStruct() : p(1) {}
const foo_t& operator[](int i) const { return p; }
@ -313,13 +313,13 @@ typedef DLL_API struct SomeStruct @@ -313,13 +313,13 @@ typedef DLL_API struct SomeStruct
}
SomeStruct;
class SomeClassExtendingTheStruct : public SomeStruct
class DLL_API SomeClassExtendingTheStruct : public SomeStruct
{
};
namespace SomeNamespace
{
class AbstractClass
class DLL_API AbstractClass
{
public:
virtual void AbstractMethod() = 0;
@ -327,10 +327,10 @@ namespace SomeNamespace @@ -327,10 +327,10 @@ namespace SomeNamespace
}
// Test operator overloads
class ClassWithOverloadedOperators
class DLL_API ClassWithOverloadedOperators
{
public:
operator char();
operator int();
operator short();
operator char() { return 1; }
operator int() { return 2; }
operator short() { return 3; }
};

Loading…
Cancel
Save