Skip to content

Commit

Permalink
Add a quick unit test for the IOS tag
Browse files Browse the repository at this point in the history
  • Loading branch information
shoebox committed Jan 6, 2015
1 parent 41378f8 commit 935dfdb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/src/IosTest.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package;

import massive.munit.util.Timer;
import massive.munit.Assert;
import massive.munit.async.AsyncFactory;

import haxe.rtti.Meta;

class IosTest
{
public function new()
{
TestIos;
}

@Test public function testLibrary()
{
Assert.areEqual(Meta.getStatics(TestIos).test1.cpp_library[0], "testextension");
Assert.areEqual(Meta.getStatics(TestIos).test2.cpp_library[0], "toto");
}

@Test public function testPrimitive()
{
Assert.areEqual(Meta.getStatics(TestIos).test1.cpp_primitive[0], "prefix_test1");
Assert.areEqual(Meta.getStatics(TestIos).test2.cpp_primitive[0], "prim");
}
}

@:build(ShortCuts.mirrors())
@CPP_DEFAULT_LIBRARY("testextension")
@CPP_PRIMITIVE_PREFIX("prefix")
class TestIos
{
@IOS public static function test1(toto:String, value:Bool):Float{return 0.0;};
@IOS("toto", "prim") public static function test2(toto:String,
value:Bool):Bool{return false;};
}
2 changes: 2 additions & 0 deletions test/src/TestSuite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AbstractTest;
import CppCallTest;
import CppTest;
import DefaultBodyTest;
import IosTest;
import JniCallTest;
import JniNonStaticTest;
import JniTest;
Expand All @@ -24,6 +25,7 @@ class TestSuite extends massive.munit.TestSuite
add(CppCallTest);
add(CppTest);
add(DefaultBodyTest);
add(IosTest);
add(JniCallTest);
add(JniNonStaticTest);
add(JniTest);
Expand Down

0 comments on commit 935dfdb

Please sign in to comment.