THRIFT-2886 Integrate binary type in standard Thrift cross test
Client: C_glib, C++, D, Erlang, Go, Haskell, Lua, Java/Me, JavaScript, Node, Ocaml, Perl, PHP, Python, Ruby
Patch: Jens Geyer
This closes #341
Minimal server-side implementations and TODO stubs for various languages to let "make check" succeeed.
Not contained in this patch and still TODO:
- client side implementations, i.e. calls to testBinary() and appropriate tests
- server side hex printout missing for some languages
diff --git a/test/hs/TestClient.hs b/test/hs/TestClient.hs
index 03314ed..6c25f5b 100644
--- a/test/hs/TestClient.hs
+++ b/test/hs/TestClient.hs
@@ -105,6 +105,8 @@
dub <- Client.testDouble prot (-5.2098523)
when (abs (dub + 5.2098523) > 0.001) exitFailure
+ -- TODO: call Client.testBinary
+
-- Struct Test
let structIn = Xtruct{ xtruct_string_thing = "Zero"
, xtruct_byte_thing = 1
diff --git a/test/hs/TestServer.hs b/test/hs/TestServer.hs
index ec3891c..d991de1 100755
--- a/test/hs/TestServer.hs
+++ b/test/hs/TestServer.hs
@@ -127,6 +127,10 @@
System.IO.putStrLn $ "testDouble(" ++ show x ++ ")"
return x
+ testBinary _ x = do
+ System.IO.putStrLn $ "testBinary(" ++ show x ++ ")"
+ return x
+
testStruct _ struct@Xtruct{..} = do
System.IO.putStrLn $ "testStruct({" ++ show xtruct_string_thing
++ ", " ++ show xtruct_byte_thing
diff --git a/test/hs/ThriftTest_Main.hs b/test/hs/ThriftTest_Main.hs
index 1139506..670023e 100755
--- a/test/hs/ThriftTest_Main.hs
+++ b/test/hs/ThriftTest_Main.hs
@@ -67,6 +67,10 @@
ThriftTestUtils.serverLog $ show x
return x
+ testBinary _ x = do
+ ThriftTestUtils.serverLog $ show x
+ return x
+
testStruct _ x = do
ThriftTestUtils.serverLog $ show x
return x
@@ -150,6 +154,8 @@
v9 <- Client.testDouble ps (-3.14)
ThriftTestUtils.clientLog $ show v9
+ -- TODO: Client.testBinary ...
+
v10 <- Client.testMap ps (Map.fromList [(1,1),(2,2),(3,3)])
ThriftTestUtils.clientLog $ show v10