[librest] tests: Don't call g_type_init() on newer glib



commit c81d89c4f0d5f0458f4794125999014657ba0eb1
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Tue Sep 2 13:47:09 2014 +0200

    tests: Don't call g_type_init() on newer glib
    
    This is deprecated and causes a compile warning
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735921

 examples/continuous-twitter.c     |    2 ++
 examples/dump-xml.c               |    2 ++
 examples/get-fireeagle-location.c |    2 ++
 examples/get-flickr-favorites.c   |    2 ++
 examples/lastfm-shout.c           |    2 ++
 examples/post-twitter-media.c     |    2 ++
 examples/post-twitter.c           |    2 ++
 examples/test-raw.c               |    2 ++
 examples/test-xml.c               |    2 ++
 rest-extras/test-runner.c         |    2 ++
 rest/test-runner.c                |    2 ++
 tests/custom-serialize.c          |    2 ++
 tests/flickr.c                    |    2 ++
 tests/lastfm.c                    |    2 ++
 tests/oauth-async.c               |    2 ++
 tests/oauth.c                     |    2 ++
 tests/oauth2.c                    |    2 ++
 tests/proxy-continuous.c          |    2 ++
 tests/proxy.c                     |    2 ++
 tests/threaded.c                  |    2 ++
 tests/xml.c                       |    2 ++
 21 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/examples/continuous-twitter.c b/examples/continuous-twitter.c
index 712aa07..dc06bde 100644
--- a/examples/continuous-twitter.c
+++ b/examples/continuous-twitter.c
@@ -43,7 +43,9 @@ main (int argc, char **argv)
   char pin[256];
   GMainLoop *loop;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   loop = g_main_loop_new (NULL, FALSE);
 
diff --git a/examples/dump-xml.c b/examples/dump-xml.c
index f9ee2b1..f574cb5 100644
--- a/examples/dump-xml.c
+++ b/examples/dump-xml.c
@@ -94,7 +94,9 @@ main (int argc, char **argv)
     return 1;
   }
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   if (!g_file_get_contents (argv[1], &data, &length, &error)) {
     g_printerr ("%s\n", error->message);
diff --git a/examples/get-fireeagle-location.c b/examples/get-fireeagle-location.c
index 664f264..101aa75 100644
--- a/examples/get-fireeagle-location.c
+++ b/examples/get-fireeagle-location.c
@@ -34,7 +34,9 @@ main (int argc, char **argv)
   RestXmlParser *parser;
   RestXmlNode *root, *node;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   /* Create the proxy */
   proxy = oauth_proxy_new (/* Consumer Key */
diff --git a/examples/get-flickr-favorites.c b/examples/get-flickr-favorites.c
index 956789b..59ca7d4 100644
--- a/examples/get-flickr-favorites.c
+++ b/examples/get-flickr-favorites.c
@@ -106,7 +106,9 @@ main (int argc, char **argv)
   char *frob, *url;
   const char *token;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   proxy = flickr_proxy_new ("cf4e02fc57240a9b07346ad26e291080", "cdfa2329cb206e50");
 
diff --git a/examples/lastfm-shout.c b/examples/lastfm-shout.c
index f1e5f69..02894a4 100644
--- a/examples/lastfm-shout.c
+++ b/examples/lastfm-shout.c
@@ -87,7 +87,9 @@ main (int argc, char **argv)
     { NULL }
   };
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   context = g_option_context_new ("- send a shout to a Last.fm user");
   g_option_context_add_main_entries (context, entries, NULL);
diff --git a/examples/post-twitter-media.c b/examples/post-twitter-media.c
index cfe118a..c4e2af3 100644
--- a/examples/post-twitter-media.c
+++ b/examples/post-twitter-media.c
@@ -33,7 +33,9 @@ main (int argc, char **argv)
   GError *error = NULL;
   char pin[256];
 
+#if !GLIB_CHECK_VERSION (2, 36 ,0)
   g_type_init ();
+#endif
 
   if (argc != 2) {
     g_printerr ("$ post-twitter-media \"message\"\n");
diff --git a/examples/post-twitter.c b/examples/post-twitter.c
index 3f9cc73..061221f 100644
--- a/examples/post-twitter.c
+++ b/examples/post-twitter.c
@@ -31,7 +31,9 @@ main (int argc, char **argv)
   GError *error = NULL;
   char pin[256];
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   if (argc != 2) {
     g_printerr ("$ post-twitter \"message\"\n");
diff --git a/examples/test-raw.c b/examples/test-raw.c
index ed8af75..ae9b016 100644
--- a/examples/test-raw.c
+++ b/examples/test-raw.c
@@ -47,7 +47,9 @@ main (gint argc, gchar **argv)
   const gchar *payload;
   gssize len;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   loop = g_main_loop_new (NULL, FALSE);
 
diff --git a/examples/test-xml.c b/examples/test-xml.c
index 5e81625..6e132f9 100644
--- a/examples/test-xml.c
+++ b/examples/test-xml.c
@@ -113,7 +113,9 @@ main (gint argc, gchar **argv)
   RestProxyCall *call;
   GMainLoop *loop;
 
+#if !GLIB_CHECK_VERSION (2, 36 ,0)
   g_type_init ();
+#endif
 
   loop = g_main_loop_new (NULL, FALSE);
 
diff --git a/rest-extras/test-runner.c b/rest-extras/test-runner.c
index 52ca1b1..1702e2c 100644
--- a/rest-extras/test-runner.c
+++ b/rest-extras/test-runner.c
@@ -26,7 +26,9 @@
 int
 main (int argc, char *argv[])
 {
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
   g_test_init (&argc, &argv, NULL);
 
   test_add ("/flickr/error", test_flickr_error);
diff --git a/rest/test-runner.c b/rest/test-runner.c
index 0baa243..2f51043 100644
--- a/rest/test-runner.c
+++ b/rest/test-runner.c
@@ -26,7 +26,9 @@
 int
 main (int argc, char *argv[])
 {
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
   g_test_init (&argc, &argv, NULL);
 
   test_add ("/oauth/param-encoding", test_param_encoding);
diff --git a/tests/custom-serialize.c b/tests/custom-serialize.c
index c6b801f..c5443b7 100644
--- a/tests/custom-serialize.c
+++ b/tests/custom-serialize.c
@@ -125,7 +125,9 @@ main (int argc, char **argv)
   int i;
   GError *error;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   session = soup_session_sync_new ();
 
diff --git a/tests/flickr.c b/tests/flickr.c
index a34025e..1befe72 100644
--- a/tests/flickr.c
+++ b/tests/flickr.c
@@ -36,7 +36,9 @@ main (int argc, char **argv)
   RestXmlParser *parser;
   RestXmlNode *root, *node;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   /* Create the proxy */
   proxy = flickr_proxy_new (API_KEY, SHARED_SECRET);
diff --git a/tests/lastfm.c b/tests/lastfm.c
index ab86575..4b281ae 100644
--- a/tests/lastfm.c
+++ b/tests/lastfm.c
@@ -37,7 +37,9 @@ main (int argc, char **argv)
   RestXmlParser *parser;
   RestXmlNode *root, *u_node, *node;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   /* Create the proxy */
   proxy = lastfm_proxy_new (API_KEY, SECRET);
diff --git a/tests/oauth-async.c b/tests/oauth-async.c
index a258127..a8fcdbb 100644
--- a/tests/oauth-async.c
+++ b/tests/oauth-async.c
@@ -119,7 +119,9 @@ main (int argc, char **argv)
   OAuthProxy *oproxy;
   GError *error = NULL;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   /* Install a timeout so that we don't hang or infinite loop */
   g_timeout_add_seconds (10, on_timeout, NULL);
diff --git a/tests/oauth.c b/tests/oauth.c
index c1db284..639060d 100644
--- a/tests/oauth.c
+++ b/tests/oauth.c
@@ -33,7 +33,9 @@ main (int argc, char **argv)
   RestProxyCall *call;
   GError *error = NULL;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   /* Create the proxy */
   proxy = oauth_proxy_new ("key", "secret",
diff --git a/tests/oauth2.c b/tests/oauth2.c
index f4819ff..7bb1561 100644
--- a/tests/oauth2.c
+++ b/tests/oauth2.c
@@ -47,7 +47,9 @@ test_extract_token ()
 int
 main (int argc, char **argv)
 {
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   test_extract_token ();
 
diff --git a/tests/proxy-continuous.c b/tests/proxy-continuous.c
index 2141dab..a739fac 100644
--- a/tests/proxy-continuous.c
+++ b/tests/proxy-continuous.c
@@ -168,7 +168,9 @@ main (int argc, char **argv)
   char *url;
   RestProxy *proxy;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
   loop = g_main_loop_new (NULL, FALSE);
 
   session = soup_session_async_new ();
diff --git a/tests/proxy.c b/tests/proxy.c
index 6e630ff..36414de 100644
--- a/tests/proxy.c
+++ b/tests/proxy.c
@@ -283,7 +283,9 @@ main (int argc, char **argv)
   char *url;
   RestProxy *proxy;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   session = soup_session_async_new ();
 
diff --git a/tests/threaded.c b/tests/threaded.c
index a0f5f0e..6283c9c 100644
--- a/tests/threaded.c
+++ b/tests/threaded.c
@@ -85,7 +85,9 @@ main (int argc, char **argv)
   char *url;
   int i;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   session = soup_session_sync_new ();
 
diff --git a/tests/xml.c b/tests/xml.c
index 85af973..161b56e 100644
--- a/tests/xml.c
+++ b/tests/xml.c
@@ -33,7 +33,9 @@ main (int argc, char **argv)
   RestXmlNode *root, *node;
   char *xml;
 
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init ();
+#endif
 
   parser = rest_xml_parser_new ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]