summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-06-20 22:58:52 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-06-20 22:58:52 -0400
commit699ab34321dff414ba3e9c8f329bfc3d2a9ff6d0 (patch)
treede670bc5d0013c78381fd2ba860302c41823b90c /tests
parent6e899cdc8210aa28fec63cce0de65338c73234d2 (diff)
downloadfarstream-699ab34321dff414ba3e9c8f329bfc3d2a9ff6d0.tar.gz
tests: Only use matching host candidates for nice force_remote_candidates test
The other candidates may or not may not work
Diffstat (limited to 'tests')
-rw-r--r--tests/check/transmitter/nice.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c
index 17caa479..a0ec84fd 100644
--- a/tests/check/transmitter/nice.c
+++ b/tests/check/transmitter/nice.c
@@ -124,24 +124,32 @@ set_the_candidates (gpointer user_data)
{
FsCandidate *cand = item->data;
GList *item2 = NULL;
+
next = g_list_next (item);
- for (item2 = new_list; item2; item2 = g_list_next (item2))
+ if (cand->type != FS_CANDIDATE_TYPE_HOST)
+ continue;
+ if (cand->component_id != 1)
+ continue;
+
+ for (item2 = candidates; item2; item2 = g_list_next (item2))
{
FsCandidate *cand2 = item2->data;
- if (cand2->component_id == cand->component_id)
- break;
- }
- if (!item2)
- {
- candidates = g_list_remove (candidates, cand);
- new_list = g_list_append (new_list, cand);
+ if (cand2->component_id == 2 &&
+ !strcmp (cand->foundation, cand2->foundation))
+ {
+ new_list = g_list_append (new_list, cand);
+ new_list = g_list_append (new_list, cand2);
+ goto got_candidates;
+ }
}
}
- ret = fs_stream_transmitter_force_remote_candidates (st, new_list, &error);
+ ts_fail ("Could not find two matching host candidates???");
- fs_candidate_list_destroy (new_list);
+ got_candidates:
+ ts_fail_unless (g_list_length (new_list) == 2);
+ ret = fs_stream_transmitter_force_remote_candidates (st, new_list, &error);
}
else
{