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/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 6d2a260..2705064 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -98,6 +98,13 @@
return thing;
}
+ void testBinary(std::string& _return, const std::string& thing) {
+ std::ostringstream hexstr;
+ hexstr << std::hex << thing;
+ printf("testBinary(%s)\n", hexstr.str().c_str());
+ _return = thing;
+ }
+
void testStruct(Xtruct& out, const Xtruct& thing) {
printf("testStruct({\"%s\", %d, %d, %" PRId64 "})\n",
thing.string_thing.c_str(),
@@ -411,6 +418,12 @@
cob(res);
}
+ virtual void testBinary(tcxx::function<void(std::string const& _return)> cob, const std::string& thing) {
+ std::string res;
+ _delegate->testBinary(res, thing);
+ cob(res);
+ }
+
virtual void testStruct(tcxx::function<void(Xtruct const& _return)> cob, const Xtruct& thing) {
Xtruct res;
_delegate->testStruct(res, thing);