Commit b370a95e authored by Youness Alaoui's avatar Youness Alaoui Committed by Olivier Crête

Fix bug in the ice-tcp unit test

parent fac1c188
...@@ -54,6 +54,7 @@ static gboolean global_lagent_gathering_done = FALSE; ...@@ -54,6 +54,7 @@ static gboolean global_lagent_gathering_done = FALSE;
static gboolean global_ragent_gathering_done = FALSE; static gboolean global_ragent_gathering_done = FALSE;
static gboolean global_lagent_ibr_received = FALSE; static gboolean global_lagent_ibr_received = FALSE;
static gboolean global_ragent_ibr_received = FALSE; static gboolean global_ragent_ibr_received = FALSE;
static gboolean global_ready_reached = FALSE;
static int global_lagent_cands = 0; static int global_lagent_cands = 0;
static int global_ragent_cands = 0; static int global_ragent_cands = 0;
static gint global_ragent_read = 0; static gint global_ragent_read = 0;
...@@ -127,7 +128,6 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin ...@@ -127,7 +128,6 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint component_id, guint state, gpointer data) static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint component_id, guint state, gpointer data)
{ {
gboolean ready_to_connected = FALSE; gboolean ready_to_connected = FALSE;
static gboolean quit_called = FALSE;
g_debug ("test-icetcp:%s: %p", G_STRFUNC, data); g_debug ("test-icetcp:%s: %p", G_STRFUNC, data);
if (GPOINTER_TO_UINT (data) == 1) { if (GPOINTER_TO_UINT (data) == 1) {
...@@ -155,9 +155,9 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint ...@@ -155,9 +155,9 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
/* signal status via a global variable */ /* signal status via a global variable */
if (global_components_ready == global_components_ready_exit && if (global_components_ready == global_components_ready_exit &&
global_components_failed == global_components_failed_exit && global_components_failed == global_components_failed_exit &&
quit_called == FALSE) { global_ready_reached == FALSE) {
g_debug ("Components ready/failed achieved. Stopping mailoop"); g_debug ("Components ready/failed achieved. Stopping mailoop");
quit_called = TRUE; global_ready_reached = TRUE;
g_main_loop_quit (global_mainloop); g_main_loop_quit (global_mainloop);
return; return;
} }
...@@ -274,6 +274,7 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas ...@@ -274,6 +274,7 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
global_ragent_ibr_received = FALSE; global_ragent_ibr_received = FALSE;
global_lagent_cands = global_lagent_cands =
global_ragent_cands = 0; global_ragent_cands = 0;
global_ready_reached = FALSE;
g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL); g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL);
g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL); g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment