summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-09-30 17:44:44 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-10-01 09:21:00 +0100
commit9f10231fc787e4683e896bf35f086906a5b16c03 (patch)
treec09dc39aa5f7e4b4a5ffa3ebef95ea1f5b98e9d7
parentdac3e280d6f3fd792f1d79313debd03c0df282c4 (diff)
downloadlibnice-9f10231fc787e4683e896bf35f086906a5b16c03.tar.gz
tests: Remove g_thread_init() calls
We depend on GLib 2.36.0; g_thread_init() has been deprecated since 2.32.0, when thread initialisation was changed to happen automatically. Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D297
-rw-r--r--tests/test-add-remove-stream.c1
-rw-r--r--tests/test-build-io-stream.c1
-rw-r--r--tests/test-credentials.c1
-rw-r--r--tests/test-dribble.c2
-rw-r--r--tests/test-fallback.c1
-rw-r--r--tests/test-fullmode.c1
-rw-r--r--tests/test-icetcp.c3
-rw-r--r--tests/test-io-stream-cancelling.c1
-rw-r--r--tests/test-io-stream-closing-read.c1
-rw-r--r--tests/test-io-stream-closing-write.c1
-rw-r--r--tests/test-io-stream-pollable.c1
-rw-r--r--tests/test-io-stream-thread.c1
-rw-r--r--tests/test-mainloop.c1
-rw-r--r--tests/test-new-dribble.c35
-rw-r--r--tests/test-restart.c1
-rw-r--r--tests/test-send-recv.c1
-rw-r--r--tests/test-thread.c1
-rw-r--r--tests/test.c2
18 files changed, 8 insertions, 48 deletions
diff --git a/tests/test-add-remove-stream.c b/tests/test-add-remove-stream.c
index 82d73bf..c97bc7b 100644
--- a/tests/test-add-remove-stream.c
+++ b/tests/test-add-remove-stream.c
@@ -54,7 +54,6 @@ main (void)
WSAStartup(0x0202, &w);
#endif
nice_address_init (&addr);
- g_thread_init (NULL);
if (!nice_address_set_from_string (&addr, "127.0.0.1"))
g_assert_not_reached ();
diff --git a/tests/test-build-io-stream.c b/tests/test-build-io-stream.c
index e814f92..a3478ed 100644
--- a/tests/test-build-io-stream.c
+++ b/tests/test-build-io-stream.c
@@ -440,7 +440,6 @@ main (void)
WSAStartup (0x0202, &w);
#endif
nice_address_init (&addr);
- g_thread_init (NULL);
g_assert (nice_address_set_from_string (&addr, "127.0.0.1"));
diff --git a/tests/test-credentials.c b/tests/test-credentials.c
index ebd3fec..1de4e49 100644
--- a/tests/test-credentials.c
+++ b/tests/test-credentials.c
@@ -172,7 +172,6 @@ int main (void)
WSADATA w;
WSAStartup(0x0202, &w);
#endif
- g_thread_init (NULL);
loop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/test-dribble.c b/tests/test-dribble.c
index 2e8b73d..d9de07b 100644
--- a/tests/test-dribble.c
+++ b/tests/test-dribble.c
@@ -215,8 +215,6 @@ int main (void)
WSAStartup(0x0202, &w);
#endif
- g_thread_init (NULL);
-
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 191f3ca..34fd1d1 100644
--- a/tests/test-fallback.c
+++ b/tests/test-fallback.c
@@ -491,7 +491,6 @@ int main (void)
WSAStartup(0x0202, &w);
#endif
- g_thread_init (NULL);
global_mainloop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/test-fullmode.c b/tests/test-fullmode.c
index 43b54c3..b599a24 100644
--- a/tests/test-fullmode.c
+++ b/tests/test-fullmode.c
@@ -834,7 +834,6 @@ int main (void)
WSAStartup(0x0202, &w);
#endif
- g_thread_init(NULL);
global_mainloop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/test-icetcp.c b/tests/test-icetcp.c
index 788719f..6812469 100644
--- a/tests/test-icetcp.c
+++ b/tests/test-icetcp.c
@@ -397,9 +397,6 @@ int main (void)
WSAStartup(0x0202, &w);
#endif
-#if !GLIB_CHECK_VERSION(2,31,8)
- g_thread_init(NULL);
-#endif
global_mainloop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/test-io-stream-cancelling.c b/tests/test-io-stream-cancelling.c
index 1aa87fb..d1b9a89 100644
--- a/tests/test-io-stream-cancelling.c
+++ b/tests/test-io-stream-cancelling.c
@@ -112,7 +112,6 @@ int main (void)
WSADATA w;
WSAStartup (0x0202, &w);
#endif
- g_thread_init (NULL);
l_data.cancellable = g_cancellable_new ();
l_data.blocking = FALSE;
diff --git a/tests/test-io-stream-closing-read.c b/tests/test-io-stream-closing-read.c
index a8f9416..5acddec 100644
--- a/tests/test-io-stream-closing-read.c
+++ b/tests/test-io-stream-closing-read.c
@@ -127,7 +127,6 @@ int main (void)
WSADATA w;
WSAStartup (0x0202, &w);
#endif
- g_thread_init (NULL);
run_io_stream_test (30, TRUE, &callbacks, (gpointer) TRUE, NULL, NULL, NULL);
diff --git a/tests/test-io-stream-closing-write.c b/tests/test-io-stream-closing-write.c
index 1a6482e..6f92f28 100644
--- a/tests/test-io-stream-closing-write.c
+++ b/tests/test-io-stream-closing-write.c
@@ -127,7 +127,6 @@ int main (void)
WSADATA w;
WSAStartup (0x0202, &w);
#endif
- g_thread_init (NULL);
run_io_stream_test (30, TRUE, &callbacks, (gpointer) TRUE, NULL, NULL, NULL);
diff --git a/tests/test-io-stream-pollable.c b/tests/test-io-stream-pollable.c
index f07139b..a543f88 100644
--- a/tests/test-io-stream-pollable.c
+++ b/tests/test-io-stream-pollable.c
@@ -159,7 +159,6 @@ int main (void)
WSADATA w;
WSAStartup (0x0202, &w);
#endif
- g_thread_init (NULL);
l_data = g_malloc0 (sizeof (ThreadData));
r_data = g_malloc0 (sizeof (ThreadData));
diff --git a/tests/test-io-stream-thread.c b/tests/test-io-stream-thread.c
index dde2d9e..73ecd76 100644
--- a/tests/test-io-stream-thread.c
+++ b/tests/test-io-stream-thread.c
@@ -124,7 +124,6 @@ int main (void)
WSADATA w;
WSAStartup (0x0202, &w);
#endif
- g_thread_init (NULL);
l_data = g_malloc0 (sizeof (ThreadData));
r_data = g_malloc0 (sizeof (ThreadData));
diff --git a/tests/test-mainloop.c b/tests/test-mainloop.c
index d168568..7c52daa 100644
--- a/tests/test-mainloop.c
+++ b/tests/test-mainloop.c
@@ -72,7 +72,6 @@ main (void)
guint stream;
nice_address_init (&addr);
- g_thread_init(NULL);
loop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/test-new-dribble.c b/tests/test-new-dribble.c
index 32f9013..22064e5 100644
--- a/tests/test-new-dribble.c
+++ b/tests/test-new-dribble.c
@@ -56,21 +56,14 @@
#define LEFT_AGENT GINT_TO_POINTER(1)
#define RIGHT_AGENT GINT_TO_POINTER(2)
-#if !GLIB_CHECK_VERSION(2,31,8)
- static GMutex *stun_mutex_ptr = NULL;
- static GCond *stun_signal_ptr = NULL;
- static GMutex *stun_thread_mutex_ptr = NULL;
- static GCond *stun_thread_signal_ptr = NULL
-#else
- static GMutex stun_mutex;
- static GMutex *stun_mutex_ptr = &stun_mutex;
- static GCond stun_signal;
- static GCond *stun_signal_ptr = &stun_signal;
- static GMutex stun_thread_mutex;
- static GMutex *stun_thread_mutex_ptr = &stun_thread_mutex;
- static GCond stun_thread_signal;
- static GCond *stun_thread_signal_ptr = &stun_thread_signal;
-#endif
+static GMutex stun_mutex;
+static GMutex *stun_mutex_ptr = &stun_mutex;
+static GCond stun_signal;
+static GCond *stun_signal_ptr = &stun_signal;
+static GMutex stun_thread_mutex;
+static GMutex *stun_thread_mutex_ptr = &stun_thread_mutex;
+static GCond stun_thread_signal;
+static GCond *stun_thread_signal_ptr = &stun_thread_signal;
static NiceComponentState global_lagent_state = NICE_COMPONENT_STATE_LAST;
static NiceComponentState global_ragent_state = NICE_COMPONENT_STATE_LAST;
@@ -737,16 +730,8 @@ int main(void)
}
-#if !GLIB_CHECK_VERSION(2,31,8)
- g_thread_init (NULL);
- stun_thread = g_thread_create (stun_thread_func, GINT_TO_POINTER (sock),
- TRUE, NULL);
- stun_mutex_ptr = g_mutex_new ();
- stun_signal_ptr = g_cond_new ();
-#else
stun_thread = g_thread_new ("listen for STUN requests",
stun_thread_func, GINT_TO_POINTER (sock));
-#endif
// Once the the thread is forked, we want to listen for a signal
// that the socket was opened successfully
@@ -801,10 +786,6 @@ int main(void)
g_object_unref (ragent);
g_thread_join (stun_thread);
-#if !GLIB_CHECK_VERSION(2,31,8)
- g_mutex_free (stun_mutex_ptr);
- g_cond_free (stun_signal_ptr);
-#endif
g_object_unref (global_cancellable);
g_source_destroy (src);
diff --git a/tests/test-restart.c b/tests/test-restart.c
index e962874..c2cbe9a 100644
--- a/tests/test-restart.c
+++ b/tests/test-restart.c
@@ -400,7 +400,6 @@ int main (void)
WSAStartup(0x0202, &w);
#endif
- g_thread_init(NULL);
global_mainloop = g_main_loop_new (NULL, FALSE);
diff --git a/tests/test-send-recv.c b/tests/test-send-recv.c
index 71d233a..5841639 100644
--- a/tests/test-send-recv.c
+++ b/tests/test-send-recv.c
@@ -1202,7 +1202,6 @@ main (int argc, char *argv[])
WSADATA w;
WSAStartup (0x0202, &w);
#endif
- g_thread_init (NULL);
if (!long_mode) {
/* Quick mode. Just test each of the stream APIs in reliable and
diff --git a/tests/test-thread.c b/tests/test-thread.c
index 2585018..e05738c 100644
--- a/tests/test-thread.c
+++ b/tests/test-thread.c
@@ -211,7 +211,6 @@ int main (void)
WSADATA w;
WSAStartup(0x0202, &w);
#endif
- g_thread_init(NULL);
lmainctx = g_main_context_new ();
rmainctx = g_main_context_new ();
diff --git a/tests/test.c b/tests/test.c
index f43d5d6..a92b33c 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -76,8 +76,6 @@ main (void)
nice_address_init (&addr_local);
nice_address_init (&addr_remote);
- g_thread_init(NULL);
-
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"));
nice_address_set_port (&addr_remote, 2345);