You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2015/07/28 23:17:00 UTC

[3/3] thrift git commit: THRIFT-3266 c_glib: Multiple compiler warnings building unit tests Client: c_glib Patch: Simon South

THRIFT-3266 c_glib: Multiple compiler warnings building unit tests
Client: c_glib
Patch: Simon South

This closes #570


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/1c190278
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/1c190278
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/1c190278

Branch: refs/heads/master
Commit: 1c1902788bef82c0dbf2b10b2d39767ce94a1c38
Parents: 57ac33e
Author: Jens Geyer <je...@apache.org>
Authored: Tue Jul 28 23:15:18 2015 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Tue Jul 28 23:15:18 2015 +0200

----------------------------------------------------------------------
 lib/c_glib/test/Makefile.am                | 1 +
 lib/c_glib/test/testapplicationexception.c | 4 ++--
 lib/c_glib/test/testbinaryprotocol.c       | 4 ++++
 lib/c_glib/test/testbufferedtransport.c    | 4 ++++
 lib/c_glib/test/testdebugproto.c           | 2 +-
 lib/c_glib/test/testframedtransport.c      | 4 ++++
 lib/c_glib/test/testmemorybuffer.c         | 3 +++
 lib/c_glib/test/testoptionalrequired.c     | 3 +++
 lib/c_glib/test/testsimpleserver.c         | 3 +++
 lib/c_glib/test/teststruct.c               | 3 +++
 lib/c_glib/test/testthrifttest.c           | 5 ++++-
 lib/c_glib/test/testthrifttestclient.cpp   | 2 ++
 lib/c_glib/test/testtransportsocket.c      | 3 +++
 13 files changed, 37 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/Makefile.am b/lib/c_glib/test/Makefile.am
index dc9432e..2a38878 100755
--- a/lib/c_glib/test/Makefile.am
+++ b/lib/c_glib/test/Makefile.am
@@ -160,6 +160,7 @@ nodist_libtestgenc_la_SOURCES = \
         gen-c_glib/t_test_thrift_test.h \
         gen-c_glib/t_test_thrift_test_types.h
 libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
+libtestgenc_la_CPPFLAGS = $(AM_CPPFLAGS) -Wno-unused-function
 
 nodist_libtestgencpp_la_SOURCES = \
         gen-cpp/ThriftTest.cpp \

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testapplicationexception.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testapplicationexception.c b/lib/c_glib/test/testapplicationexception.c
index 2481340..89e39e2 100644
--- a/lib/c_glib/test/testapplicationexception.c
+++ b/lib/c_glib/test/testapplicationexception.c
@@ -99,7 +99,7 @@ test_properties_test (void)
 
 /* "g_test_expect_message" is required for the property range tests below but is
    not present in GLib before version 2.34 */
-#if (GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION >= 34)
+#if (GLIB_CHECK_VERSION (2, 34, 0))
   g_object_set (xception,
                 "type", THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN,
                 NULL);
@@ -161,7 +161,7 @@ test_properties_message (void)
 int
 main (int argc, char **argv)
 {
-#if (GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 36)
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init ();
 #endif
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testbinaryprotocol.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testbinaryprotocol.c b/lib/c_glib/test/testbinaryprotocol.c
index f75c796..c6de385 100755
--- a/lib/c_glib/test/testbinaryprotocol.c
+++ b/lib/c_glib/test/testbinaryprotocol.c
@@ -23,6 +23,7 @@
 #include <assert.h>
 #include <netdb.h>
 #include <string.h>
+#include <sys/wait.h>
 
 #include <thrift/c_glib/protocol/thrift_protocol.h>
 #include <thrift/c_glib/transport/thrift_socket.h>
@@ -660,7 +661,10 @@ thrift_server_complex_types (const int port)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testbinaryprotocol/CreateAndDestroy", test_create_and_destroy);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testbufferedtransport.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testbufferedtransport.c b/lib/c_glib/test/testbufferedtransport.c
index 7d9c46d..e4bee69 100755
--- a/lib/c_glib/test/testbufferedtransport.c
+++ b/lib/c_glib/test/testbufferedtransport.c
@@ -20,6 +20,7 @@
 #include <assert.h>
 #include <netdb.h>
 #include <signal.h>
+#include <sys/wait.h>
 
 #include <thrift/c_glib/transport/thrift_transport.h>
 #include <thrift/c_glib/transport/thrift_socket.h>
@@ -273,7 +274,10 @@ test_write_fail(void)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testbufferedtransport/CreateAndDestroy", test_create_and_destroy);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testdebugproto.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testdebugproto.c b/lib/c_glib/test/testdebugproto.c
index e343c1e..703dff0 100644
--- a/lib/c_glib/test/testdebugproto.c
+++ b/lib/c_glib/test/testdebugproto.c
@@ -864,7 +864,7 @@ test_services_inherited (void)
 int
 main(int argc, char *argv[])
 {
-#if (GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 36)
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init ();
 #endif
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testframedtransport.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testframedtransport.c b/lib/c_glib/test/testframedtransport.c
index 843ad93..7261ff5 100755
--- a/lib/c_glib/test/testframedtransport.c
+++ b/lib/c_glib/test/testframedtransport.c
@@ -19,6 +19,7 @@
 
 #include <assert.h>
 #include <netdb.h>
+#include <sys/wait.h>
 
 #include <thrift/c_glib/transport/thrift_transport.h>
 #include <thrift/c_glib/transport/thrift_socket.h>
@@ -271,7 +272,10 @@ thrift_server (const int port)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testframedtransport/CreateAndDestroy", test_create_and_destroy);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testmemorybuffer.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testmemorybuffer.c b/lib/c_glib/test/testmemorybuffer.c
index 7169a5c..5c75273 100755
--- a/lib/c_glib/test/testmemorybuffer.c
+++ b/lib/c_glib/test/testmemorybuffer.c
@@ -84,7 +84,10 @@ test_read_and_write(void)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testmemorybuffer/CreateAndDestroy", test_create_and_destroy);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testoptionalrequired.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testoptionalrequired.c b/lib/c_glib/test/testoptionalrequired.c
index 2839dd4..931d8be 100755
--- a/lib/c_glib/test/testoptionalrequired.c
+++ b/lib/c_glib/test/testoptionalrequired.c
@@ -190,7 +190,10 @@ test_tricky4 (void)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testoptionalrequired/OldSchool", test_old_school1);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testsimpleserver.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testsimpleserver.c b/lib/c_glib/test/testsimpleserver.c
index 92629b4..cb270b4 100755
--- a/lib/c_glib/test/testsimpleserver.c
+++ b/lib/c_glib/test/testsimpleserver.c
@@ -106,7 +106,10 @@ test_server (void)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testsimpleserver/SimpleServer", test_server);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/teststruct.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/teststruct.c b/lib/c_glib/test/teststruct.c
index 182a6ac..a1b3cc0 100755
--- a/lib/c_glib/test/teststruct.c
+++ b/lib/c_glib/test/teststruct.c
@@ -92,7 +92,10 @@ test_initialize_object (void)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/teststruct/InitializeObject", test_initialize_object);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testthrifttest.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testthrifttest.c b/lib/c_glib/test/testthrifttest.c
index a42d089..5f0f6e3 100755
--- a/lib/c_glib/test/testthrifttest.c
+++ b/lib/c_glib/test/testthrifttest.c
@@ -8,7 +8,7 @@ static const char TEST_ADDRESS[] = "localhost";
 static const int TEST_PORT = 64444;
 
 static void
-test_thrift_server (const int port)
+test_thrift_server (void)
 {
   ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
                                               "port", TEST_PORT, NULL);
@@ -19,7 +19,10 @@ test_thrift_server (const int port)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testthrift/Server", test_thrift_server);

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testthrifttestclient.cpp
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index d387396..faf81db 100755
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -354,8 +354,10 @@ test_thrift_client (void)
   TTestXception *xception = NULL;
   TTestXception2 *xception2 = NULL;
 
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   // initialize gobject
   g_type_init ();
+#endif
 
   // create a C client
   tsocket = (ThriftSocket *) g_object_new (THRIFT_TYPE_SOCKET, 

http://git-wip-us.apache.org/repos/asf/thrift/blob/1c190278/lib/c_glib/test/testtransportsocket.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testtransportsocket.c b/lib/c_glib/test/testtransportsocket.c
index 08cad1c..bb1d47c 100755
--- a/lib/c_glib/test/testtransportsocket.c
+++ b/lib/c_glib/test/testtransportsocket.c
@@ -310,7 +310,10 @@ thrift_socket_server (const int port)
 int
 main(int argc, char *argv[])
 {
+#if (!GLIB_CHECK_VERSION (2, 36, 0))
   g_type_init();
+#endif
+
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/testtransportsocket/CreateAndDestroy", test_create_and_destroy);