Browse Source

Added a test for unions.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/151/head
Dimitar Dobrev 12 years ago
parent
commit
df4391a340
  1. 9
      tests/Basic/Basic.Tests.cs
  2. 1
      tests/Basic/Basic.h

9
tests/Basic/Basic.Tests.cs

@ -164,5 +164,14 @@ public class BasicTests : GeneratorTestFixture
var doubleSum = delegates.A(2) + delegates.B(2); var doubleSum = delegates.A(2) + delegates.B(2);
Assert.AreEqual(8, doubleSum); Assert.AreEqual(8, doubleSum);
} }
[Test]
public void TestUnion()
{
Hello.NestedPublic nestedPublic = new Hello.NestedPublic();
nestedPublic.j = 5;
Assert.That(nestedPublic.l, Is.EqualTo(5));
Assert.That(nestedPublic.g, Is.Not.EqualTo(0));
}
} }

1
tests/Basic/Basic.h

@ -90,6 +90,7 @@ public:
union NestedPublic { union NestedPublic {
int j; int j;
float g; float g;
long l;
}; };
Hello (); Hello ();

Loading…
Cancel
Save