summaryrefslogtreecommitdiff
path: root/test/c_glib
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2014-12-14 03:14:26 +0100
committerJens Geyer <jensg@apache.org>2015-01-03 17:37:54 +0100
commit8bcfdd98ae59d840b677a485b74dda3953b4bcc1 (patch)
tree659ef62202eea161ca503d7ab3250238830abc8f /test/c_glib
parent43e195afcd4cd3db67c7343271920af147e268e6 (diff)
downloadthrift-8bcfdd98ae59d840b677a485b74dda3953b4bcc1.tar.gz
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
Diffstat (limited to 'test/c_glib')
-rw-r--r--test/c_glib/src/test_client.c2
-rw-r--r--test/c_glib/src/thrift_test_handler.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/test/c_glib/src/test_client.c b/test/c_glib/src/test_client.c
index 59f4157a0..dba2daf13 100644
--- a/test/c_glib/src/test_client.c
+++ b/test/c_glib/src/test_client.c
@@ -379,6 +379,8 @@ main (int argc, char **argv)
fail_count++;
}
+ // TODO: add testBinary()
+
/**
* STRUCT TEST
*/
diff --git a/test/c_glib/src/thrift_test_handler.c b/test/c_glib/src/thrift_test_handler.c
index 596e615a9..ae273bf37 100644
--- a/test/c_glib/src/thrift_test_handler.c
+++ b/test/c_glib/src/thrift_test_handler.c
@@ -119,6 +119,21 @@ thrift_test_handler_test_double (TTestThriftTestIf *iface,
return TRUE;
}
+gboolean
+thrift_test_handler_test_binary (TTestThriftTestIf *iface,
+ GByteArray ** _return,
+ const GByteArray * thing,
+ GError **error)
+{
+ THRIFT_UNUSED_VAR (iface);
+ THRIFT_UNUSED_VAR (error);
+
+ printf ("testBinary()\n"); // TODO: hex output
+ g_byte_array_append( *_return, thing->data, thing->len);
+
+ return TRUE;
+}
+
gboolean
thrift_test_handler_test_struct (TTestThriftTestIf *iface,
TTestXtruct **_return,