summaryrefslogtreecommitdiff
path: root/test/haxe
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2015-09-22 00:11:01 +0200
committerJens Geyer <jensg@apache.org>2015-09-22 00:29:32 +0200
commitfa2daef14bae4aea655a94b91a2e4c479debf9c2 (patch)
treefc0b4b99a788342f120518df6d586eb1cefb3a75 /test/haxe
parent39ba6b71f575432140db5fbd0debee232f097194 (diff)
downloadthrift-fa2daef14bae4aea655a94b91a2e4c479debf9c2.tar.gz
THRIFT-3341 Add testBool methods
Client: Haxe Patch: Jens Geyer This closes #614
Diffstat (limited to 'test/haxe')
-rw-r--r--test/haxe/src/TestClient.hx13
-rw-r--r--test/haxe/src/TestServerHandler.hx13
2 files changed, 26 insertions, 0 deletions
diff --git a/test/haxe/src/TestClient.hx b/test/haxe/src/TestClient.hx
index 8e43c76df..5c0de7c76 100644
--- a/test/haxe/src/TestClient.hx
+++ b/test/haxe/src/TestClient.hx
@@ -322,6 +322,8 @@ class TestClient {
// core module unit tests
public static function ModuleUnitTests( args : Arguments, rslt : TestResults) : Void {
+ #if debug
+
try {
BitConverter.UnitTest();
rslt.Expect( true, 'BitConverter.UnitTest Test #100');
@@ -337,6 +339,8 @@ class TestClient {
catch( e : Dynamic) {
rslt.Expect( false, 'ZigZag.UnitTest: $e Test #101');
}
+
+ #end
}
@@ -457,6 +461,15 @@ class TestClient {
trace(' = void');
rslt.Expect(true,"testVoid()"); // bump counter
+ trace('testBool(${true})');
+ var b = client.testBool(true);
+ trace(' = $b');
+ rslt.Expect(b, '$b == "${true}"');
+ trace('testBool(${false})');
+ b = client.testBool(false);
+ trace(' = $b');
+ rslt.Expect( ! b, '$b == "${false}"');
+
trace('testString("Test")');
var s = client.testString("Test");
trace(' = "$s"');
diff --git a/test/haxe/src/TestServerHandler.hx b/test/haxe/src/TestServerHandler.hx
index abcef1349..74a8805d4 100644
--- a/test/haxe/src/TestServerHandler.hx
+++ b/test/haxe/src/TestServerHandler.hx
@@ -51,6 +51,19 @@ class TestServerHandler implements ThriftTest {
trace("testVoid()");
}
+ /**
+ * Prints 'testBool("%s")' where '%s' with thing as 'true' or 'false'
+ * @param bool thing - the bool data to print
+ * @return bool - returns the bool 'thing'
+ *
+ * @param thing
+ */
+ public function testBool(thing : Bool) : Bool
+ {
+ trace('testBool($thing)');
+ return thing;
+ }
+
/**
* Prints 'testString("%s")' with thing as '%s'
* @param string thing - the string to print