You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2015/09/22 00:29:57 UTC

[1/2] thrift git commit: THRIFT-3341 Add testBool methods Client: Delphi Patch: Jens Geyer

Repository: thrift
Updated Branches:
  refs/heads/master 2a640c4ca -> fa2daef14


THRIFT-3341 Add testBool methods
Client: Delphi
Patch: Jens Geyer


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/39ba6b71
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/39ba6b71
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/39ba6b71

Branch: refs/heads/master
Commit: 39ba6b71f575432140db5fbd0debee232f097194
Parents: 2a640c4
Author: Jens Geyer <je...@apache.org>
Authored: Tue Sep 22 00:00:49 2015 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Tue Sep 22 00:23:51 2015 +0200

----------------------------------------------------------------------
 lib/delphi/test/TestClient.pas | 5 +++++
 lib/delphi/test/TestServer.pas | 7 +++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/39ba6b71/lib/delphi/test/TestClient.pas
----------------------------------------------------------------------
diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index 08b3965..5f375ef 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -510,6 +510,11 @@ begin
   client.testVoid();
   Expect( TRUE, 'testVoid()');  // success := no exception
 
+  s := BoolToString( client.testBool(TRUE));
+  Expect( s = BoolToString(TRUE),  'testBool(TRUE) = '+s);
+  s := BoolToString( client.testBool(FALSE));
+  Expect( s = BoolToString(FALSE),  'testBool(FALSE) = '+s);
+
   s := client.testString('Test');
   Expect( s = 'Test', 'testString(''Test'') = "'+s+'"');
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/39ba6b71/lib/delphi/test/TestServer.pas
----------------------------------------------------------------------
diff --git a/lib/delphi/test/TestServer.pas b/lib/delphi/test/TestServer.pas
index 4f599ea..018282c 100644
--- a/lib/delphi/test/TestServer.pas
+++ b/lib/delphi/test/TestServer.pas
@@ -58,6 +58,7 @@ type
         FServer : IServer;
       protected
         procedure testVoid();
+        function testBool(thing: Boolean): Boolean;
         function testString(const thing: string): string;
         function testByte(thing: ShortInt): ShortInt;
         function testI32(thing: Integer): Integer;
@@ -394,6 +395,12 @@ begin
   end;
 end;
 
+function TTestServer.TTestHandlerImpl.testBool(thing: Boolean): Boolean;
+begin
+  Console.WriteLine('testBool(' + BoolToStr(thing,true) + ')');
+  Result := thing;
+end;
+
 function TTestServer.TTestHandlerImpl.testString( const thing: string): string;
 begin
   Console.WriteLine('teststring("' + thing + '")');


[2/2] thrift git commit: THRIFT-3341 Add testBool methods Client: Haxe Patch: Jens Geyer

Posted by je...@apache.org.
THRIFT-3341 Add testBool methods
Client: Haxe
Patch: Jens Geyer

This closes #614


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/fa2daef1
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/fa2daef1
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/fa2daef1

Branch: refs/heads/master
Commit: fa2daef14bae4aea655a94b91a2e4c479debf9c2
Parents: 39ba6b7
Author: Jens Geyer <je...@apache.org>
Authored: Tue Sep 22 00:11:01 2015 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Tue Sep 22 00:29:32 2015 +0200

----------------------------------------------------------------------
 test/haxe/src/TestClient.hx        | 13 +++++++++++++
 test/haxe/src/TestServerHandler.hx | 13 +++++++++++++
 2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/fa2daef1/test/haxe/src/TestClient.hx
----------------------------------------------------------------------
diff --git a/test/haxe/src/TestClient.hx b/test/haxe/src/TestClient.hx
index 8e43c76..5c0de7c 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"');

http://git-wip-us.apache.org/repos/asf/thrift/blob/fa2daef1/test/haxe/src/TestServerHandler.hx
----------------------------------------------------------------------
diff --git a/test/haxe/src/TestServerHandler.hx b/test/haxe/src/TestServerHandler.hx
index abcef13..74a8805 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