summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2019-07-31 14:51:04 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2019-07-31 14:51:04 -0400
commit6b16df212cd60a90f69cbb285e6e5c2a2753a1ff (patch)
treeb2ccecd5989b88ce80bbae6d51eea4bd4b5d5057
parentb6925dc8af7bbd4a069aacf4c51dec1683f796bf (diff)
downloadlibnice-6b16df212cd60a90f69cbb285e6e5c2a2753a1ff.tar.gz
test-turn: Initialize variable earlier to avoid race
-rw-r--r--tests/test-turn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-turn.c b/tests/test-turn.c
index 8122d8e..24783d0 100644
--- a/tests/test-turn.c
+++ b/tests/test-turn.c
@@ -222,6 +222,10 @@ run_test(guint turn_port, gboolean is_ipv6,
nice_agent_set_relay_info(ragent, rs_id, 1,
localhost, turn_port, TURN_USER, TURN_PASS, turn_type);
+ g_assert (global_lagent_gathering_done == FALSE);
+ g_assert (global_ragent_gathering_done == FALSE);
+ g_debug ("test-turn: Added streams, running context until 'candidate-gathering-done'...");
+
/* Gather candidates and test nice_agent_set_port_range */
g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
g_assert (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
@@ -231,9 +235,6 @@ run_test(guint turn_port, gboolean is_ipv6,
nice_agent_attach_recv (ragent, rs_id, NICE_COMPONENT_TYPE_RTP,
g_main_context_default (), cb_nice_recv, GUINT_TO_POINTER (2));
- g_assert (global_lagent_gathering_done == FALSE);
- g_assert (global_ragent_gathering_done == FALSE);
- g_debug ("test-turn: Added streams, running context until 'candidate-gathering-done'...");
while (!global_lagent_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_assert (global_lagent_gathering_done == TRUE);