summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRohan Garg <rohan16garg@gmail.com>2012-01-17 04:06:03 +0530
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2012-01-16 18:05:14 -0500
commitfb6df6a0a1ee9b8ddf63590dd6c25403265cad47 (patch)
tree7747fc0afde660bc7314b9f7a60de61d7523d0ac /tests
parentacbd8f090fe03afe5e9f753c171384eff4a4ad87 (diff)
downloadlibnice-fb6df6a0a1ee9b8ddf63590dd6c25403265cad47.tar.gz
Fix builds for systems using glib 2.3.81 and above
Diffstat (limited to 'tests')
-rw-r--r--tests/test-add-remove-stream.c3
-rw-r--r--tests/test-dribble.c3
-rw-r--r--tests/test-fallback.c3
-rw-r--r--tests/test-fullmode.c5
-rw-r--r--tests/test-mainloop.c5
-rw-r--r--tests/test-restart.c5
-rw-r--r--tests/test-thread.c19
-rw-r--r--tests/test.c4
8 files changed, 39 insertions, 8 deletions
diff --git a/tests/test-add-remove-stream.c b/tests/test-add-remove-stream.c
index af797c4..d9c2618 100644
--- a/tests/test-add-remove-stream.c
+++ b/tests/test-add-remove-stream.c
@@ -51,8 +51,9 @@ main (void)
nice_address_init (&addr);
g_type_init ();
+#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init (NULL);
-
+#endif
if (!nice_address_set_from_string (&addr, "127.0.0.1"))
g_assert_not_reached ();
diff --git a/tests/test-dribble.c b/tests/test-dribble.c
index 4286586..3c9f732 100644
--- a/tests/test-dribble.c
+++ b/tests/test-dribble.c
@@ -208,7 +208,10 @@ int main (void)
guint ls_id, rs_id;
g_type_init ();
+#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init (NULL);
+#endif
+
global_mainloop = g_main_loop_new (NULL, FALSE);
/* step: create the agents L and R */
diff --git a/tests/test-fallback.c b/tests/test-fallback.c
index e7437b6..5c5b3b6 100644
--- a/tests/test-fallback.c
+++ b/tests/test-fallback.c
@@ -484,7 +484,10 @@ int main (void)
const char *stun_server = NULL, *stun_server_port = NULL;
g_type_init ();
+#if !GLIB_CHECK_VERSION(2,31,8)
g_thread_init (NULL);
+#endif
+
global_mainloop = g_main_loop_new (NULL, FALSE);
/* Note: impl limits ...
diff --git a/tests/test-fullmode.c b/tests/test-fullmode.c
index 39aea0f..3a45acb 100644
--- a/tests/test-fullmode.c
+++ b/tests/test-fullmode.c
@@ -804,7 +804,10 @@ int main (void)
const char *stun_server = NULL, *stun_server_port = NULL;
g_type_init ();
- g_thread_init (NULL);
+#if !GLIB_CHECK_VERSION(2,31,8)
+ g_thread_init(NULL);
+#endif
+
global_mainloop = g_main_loop_new (NULL, FALSE);
/* Note: impl limits ...
diff --git a/tests/test-mainloop.c b/tests/test-mainloop.c
index 9c3852a..f5aaa55 100644
--- a/tests/test-mainloop.c
+++ b/tests/test-mainloop.c
@@ -73,7 +73,10 @@ main (void)
nice_address_init (&addr);
g_type_init ();
- g_thread_init (NULL);
+#if !GLIB_CHECK_VERSION(2,31,8)
+ g_thread_init(NULL);
+#endif
+
loop = g_main_loop_new (NULL, FALSE);
agent = nice_agent_new (g_main_loop_get_context (loop), NICE_COMPATIBILITY_RFC5245);
diff --git a/tests/test-restart.c b/tests/test-restart.c
index fce7f2a..e6300da 100644
--- a/tests/test-restart.c
+++ b/tests/test-restart.c
@@ -394,7 +394,10 @@ int main (void)
const char *stun_server = NULL, *stun_server_port = NULL;
g_type_init ();
- g_thread_init (NULL);
+#if !GLIB_CHECK_VERSION(2,31,8)
+ g_thread_init(NULL)
+#endif
+
global_mainloop = g_main_loop_new (NULL, FALSE);
/* Note: impl limits ...
diff --git a/tests/test-thread.c b/tests/test-thread.c
index 3af4673..bfe393f 100644
--- a/tests/test-thread.c
+++ b/tests/test-thread.c
@@ -189,7 +189,9 @@ int main (void)
GThread *ldthread, *rdthread;
g_type_init ();
- g_thread_init (NULL);
+#if !GLIB_CHECK_VERSION(2,31,8)
+ g_thread_init(NULL);
+#endif
lmainctx = g_main_context_new ();
rmainctx = g_main_context_new ();
@@ -268,9 +270,15 @@ int main (void)
/* step: run test the first time */
g_debug ("test-thread: TEST STARTS / running test for the 1st time");
+#if !GLIB_CHECK_VERSION(2,31,8)
lthread = g_thread_create (mainloop_thread, lmainloop, TRUE, NULL);
- g_assert (lthread);
rthread = g_thread_create (mainloop_thread, rmainloop, TRUE, NULL);
+#else
+ lthread = g_thread_new ("lthread libnice", mainloop_thread, lmainloop);
+ rthread = g_thread_new ("rthread libnice", mainloop_thread, rmainloop);
+#endif
+
+ g_assert (lthread);
g_assert (rthread);
ls_id = nice_agent_add_stream (lagent, 2);
@@ -289,9 +297,14 @@ int main (void)
nice_agent_attach_recv (ragent, rs_id, 1, rdmainctx, cb_nice_recv,
GUINT_TO_POINTER (2));
+#if !GLIB_CHECK_VERSION(2,31,8)
ldthread = g_thread_create (mainloop_thread, ldmainloop, TRUE, NULL);
- g_assert (ldthread);
rdthread = g_thread_create (mainloop_thread, rdmainloop, TRUE, NULL);
+#else
+ ldthread = g_thread_new ("ldthread libnice", mainloop_thread, ldmainloop);
+ rdthread = g_thread_new ("rdthread libnice", mainloop_thread, rdmainloop);
+#endif
+ g_assert (ldthread);
g_assert (rdthread);
/* Run loop for error timer */
diff --git a/tests/test.c b/tests/test.c
index a76b1a4..98e38d2 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -55,8 +55,10 @@ main (void)
nice_address_init (&addr_local);
nice_address_init (&addr_remote);
g_type_init ();
- g_thread_init (NULL);
+#if !GLIB_CHECK_VERSION(2,31,8)
+ g_thread_init(NULL);
+#endif
g_assert (nice_address_set_from_string (&addr_local, "127.0.0.1"));
g_assert (nice_address_set_from_string (&addr_remote, "127.0.0.1"));