Enhance C++ test client to make sure that async void is implemented properly
Summary:
Added another i32 test after the async test. If testAsync improperly
sends a response, then the i32 test will fail because the function
name won't match up, since it will be "off by one".
Test plan:
Tested cpp server and it works. Tested alterl server which
doesn't yet implement async void properly and verified failure
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665486 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 2b8cced..4b82619 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -443,6 +443,22 @@
}
}
+ /**
+ * redo a simple test after the async to make sure we aren't "off by one" --
+ * if the server treated async void like normal void, this next test will
+ * fail since it will get the void confirmation rather than the correct
+ * result. In this circumstance, the client will throw the exception:
+ *
+ * TApplicationException: Wrong method namea
+ */
+ /**
+ * I32 TEST
+ */
+ printf("re-test testI32(-1)");
+ i32 = testClient.testI32(-1);
+ printf(" = %d\n", i32);
+
+
uint64_t stop = now();
uint64_t tot = stop-start;