From: Mark Slee Date: Wed, 24 Jan 2007 23:42:12 +0000 (+0000) Subject: Add some smaller test cases and fix new single protocol/transport C++ test X-Git-Tag: 0.2.0~1528 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=9e288d4f7ad0b55f5a1c6b0010f4f0a5d935fece;p=common%2Fthrift.git Add some smaller test cases and fix new single protocol/transport C++ test Reviewed By: aditya git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664944 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/SmallTest.thrift b/test/SmallTest.thrift new file mode 100644 index 00000000..6e89221f --- /dev/null +++ b/test/SmallTest.thrift @@ -0,0 +1,17 @@ +struct Hello { + 1: i32 simple, + 2: map complex, + 3: map> complexer, +} + +exception Goodbye { + 1: i32 simple, + 2: map complex, + 3: map> complexer, +} + +service SmallService { + Hello testMe(1:i32 hello, 2: Hello wonk) throws (1: Goodbye g), + void testVoid() throws (1: Goodbye g), + i32 testI32(1:i32 boo) +} diff --git a/test/cpp/Makefile.thrift b/test/cpp/Makefile.thrift index d8ef54db..53f43b3b 100644 --- a/test/cpp/Makefile.thrift +++ b/test/cpp/Makefile.thrift @@ -32,7 +32,9 @@ LD = g++ # Compiler flags DCFL = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent -CFL = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent +LFL = -L$(thrift_home)/lib/cpp/.libs -lthrift -levent +CCFL = -Wall -O3 -I./gen-cpp $(include_flags) +CFL = $(CCFL) $(LFL) all: server client @@ -53,5 +55,9 @@ server: stubs client: stubs g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp +small: + $(THRIFT) -cpp ../SmallTest.thrift + g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp + clean: rm -fr TestServer TestClient gen-cpp diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp index d7191cab..38684564 100644 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -75,7 +75,7 @@ int main(int argc, char** argv) { transport = bufferedSocket; } - shared_ptr protocol(new TBinaryProtocol(transport, transport)); + shared_ptr protocol(new TBinaryProtocol(transport)); ThriftTestClient testClient(protocol); uint64_t time_min = 0;