THRIFT-3337 Add testBool method to cross tests
This closes #611
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index fa5b635..1c0254b 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -307,6 +307,21 @@
failCount++;
/**
+ * BOOL TEST
+ */
+ printf("testBool(true)");
+ bool bl = testClient.testBool(true);
+ printf(" = %s\n", bl ? "true" : "false");
+ if (bl != true)
+ failCount++;
+
+ printf("testBool(false)");
+ bl = testClient.testBool(false);
+ printf(" = %s\n", bl ? "true" : "false");
+ if (bl != false)
+ failCount++;
+
+ /**
* BYTE TEST
*/
printf("testByte(1)");
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 7b3c04b..e5bc31e 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -78,6 +78,11 @@
out = thing;
}
+ bool testBool(const bool thing) {
+ printf("testBool(%s)\n", thing ? "true" : "false");
+ return thing;
+ }
+
int8_t testByte(const int8_t thing) {
printf("testByte(%d)\n", (int)thing);
return thing;
@@ -398,6 +403,11 @@
cob(res);
}
+ virtual void testBool(tcxx::function<void(bool const& _return)> cob, const bool thing) {
+ bool res = _delegate->testBool(thing);
+ cob(res);
+ }
+
virtual void testByte(tcxx::function<void(int8_t const& _return)> cob, const int8_t thing) {
int8_t res = _delegate->testByte(thing);
cob(res);