From: Roger Meier Date: Tue, 31 May 2011 20:35:37 +0000 (+0000) Subject: THRIFT-1166 C++ tests in test/cpp broken X-Git-Tag: 0.7.0~86 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=bb09f4442a783d9e9d8d46501b9e2f40ecf6e4ae;p=common%2Fthrift.git THRIFT-1166 C++ tests in test/cpp broken Patch: David Nadlinger, Roger Meier git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1129908 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/transport/THttpClient.cpp index d7833512..04864cef 100644 --- a/lib/cpp/src/transport/THttpClient.cpp +++ b/lib/cpp/src/transport/THttpClient.cpp @@ -43,7 +43,6 @@ void THttpClient::parseHeader(char* header) { if (colon == NULL) { return; } - uint32_t sz = colon - header; char* value = colon+1; if (boost::istarts_with(header, "Transfer-Encoding")) { diff --git a/test/cpp/Stress-test.mk b/test/cpp/Stress-test.mk index 1a753b3a..049bcb8f 100644 --- a/test/cpp/Stress-test.mk +++ b/test/cpp/Stress-test.mk @@ -56,16 +56,16 @@ stubs: ../StressTest.thrift $(THRIFT) --gen cpp --gen php ../StressTest.thrift stress-test-debug-nb: stubs - g++ -o stress-test-nb $(DCFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp + $(CC) -o stress-test-nb $(DCFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp stress-test-nb: stubs - g++ -o stress-test-nb $(CFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp + $(CC) -o stress-test-nb $(CFL) src/nb-main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp stress-test-debug: stubs - g++ -o stress-test $(DCFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp + $(CC) -o stress-test $(DCFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp stress-test: stubs - g++ -o stress-test $(CFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp + $(CC) -o stress-test $(CFL) src/main.cpp ./gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp clean: rm -fr stress-test stress-test-nb gen-cpp diff --git a/test/cpp/Thrift-test.mk b/test/cpp/Thrift-test.mk index 2e17e7e0..6987e33f 100644 --- a/test/cpp/Thrift-test.mk +++ b/test/cpp/Thrift-test.mk @@ -59,20 +59,20 @@ stubs: ../ThriftTest.thrift $(THRIFT) --gen cpp:templates ../ThriftTest.thrift server-debug: stubs - g++ -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp $(thrift_home)/lib/cpp/test/ThriftTest_extras.cpp + $(CC) -o TestServer $(DCFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ./gen-cpp/ThriftTest_constants.cpp client-debug: stubs - g++ -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp $(thrift_home)/lib/cpp/test/ThriftTest_extras.cpp + $(CC) -o TestClient $(DCFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ./gen-cpp/ThriftTest_constants.cpp server: stubs - g++ -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp $(thrift_home)/lib/cpp/test/ThriftTest_extras.cpp + $(CC) -o TestServer $(CFL) src/TestServer.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ./gen-cpp/ThriftTest_constants.cpp client: stubs - g++ -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp $(thrift_home)/lib/cpp/test/ThriftTest_extras.cpp + $(CC) -o TestClient $(CFL) src/TestClient.cpp ./gen-cpp/ThriftTest.cpp ./gen-cpp/ThriftTest_types.cpp ./gen-cpp/ThriftTest_constants.cpp small: $(THRIFT) --gen cpp:templates ../SmallTest.thrift - g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp + $(CC) -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp clean: rm -fr *.o TestServer TestClient gen-cpp diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp index 7e37e856..417a7a14 100644 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -92,8 +92,6 @@ int main(int argc, char** argv) { shared_ptr transport; - shared_ptr socket(new TSocket(host, port)); - if (framed) { shared_ptr framedSocket(new TFramedTransport(socket)); transport = framedSocket; diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp index 047dd331..84016470 100644 --- a/test/cpp/src/TestServer.cpp +++ b/test/cpp/src/TestServer.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include "ThriftTest.h" diff --git a/test/cpp/src/main.cpp b/test/cpp/src/main.cpp index c4124c30..0c919563 100644 --- a/test/cpp/src/main.cpp +++ b/test/cpp/src/main.cpp @@ -38,11 +38,7 @@ #include #include #include - #include -#include -using __gnu_cxx::hash_map; -using __gnu_cxx::hash; using namespace std; using namespace boost; @@ -325,7 +321,7 @@ int main(int argc, char **argv) { workerCount = atoi(args["workers"].c_str()); } - } catch(exception& e) { + } catch(std::exception& e) { cerr << e.what() << endl; cerr << usage; } diff --git a/test/cpp/src/nb-main.cpp b/test/cpp/src/nb-main.cpp index 6887e4e1..7650d492 100644 --- a/test/cpp/src/nb-main.cpp +++ b/test/cpp/src/nb-main.cpp @@ -42,11 +42,7 @@ #include #include #include - #include -#include -using __gnu_cxx::hash_map; -using __gnu_cxx::hash; using namespace std; using namespace boost; @@ -320,7 +316,7 @@ int main(int argc, char **argv) { workerCount = atoi(args["workers"].c_str()); } - } catch(exception& e) { + } catch(std::exception& e) { cerr << e.what() << endl; cerr << usage; } diff --git a/test/threads/Makefile b/test/threads/Makefile index 14f1a589..df723969 100644 --- a/test/threads/Makefile +++ b/test/threads/Makefile @@ -54,10 +54,10 @@ stubs: ThreadsTest.thrift $(THRIFT) --gen cpp --gen py ThreadsTest.thrift server: stubs - g++ -o ThreadsServer $(CFL) ThreadsServer.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp + $(CC) -o ThreadsServer $(CFL) ThreadsServer.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp client: stubs - g++ -o ThreadsClient $(CFL) ThreadsClient.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp + $(CC) -o ThreadsClient $(CFL) ThreadsClient.cpp ./gen-cpp/ThreadsTest.cpp ./gen-cpp/ThreadsTest_types.cpp clean: $(RM) -r *.o ThreadsServer ThreadsClient gen-cpp gen-py