From: David Reiss Date: Mon, 18 Feb 2008 02:11:52 +0000 (+0000) Subject: Enhance C++ test client to make sure that async void is implemented properly X-Git-Tag: 0.2.0~986 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=2845b52f47a361d89434b3234545811e082f7716;p=common%2Fthrift.git 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 2b8ccedd..4b82619e 100644 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -443,6 +443,22 @@ int main(int argc, char** argv) { } } + /** + * 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;