[farsight2/master] Move rtp tests to new candidate api

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:23:37 PST 2008


---
 tests/check/rtp/conference.c |    5 ++++-
 tests/check/rtp/sendcodecs.c |   14 ++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/tests/check/rtp/conference.c b/tests/check/rtp/conference.c
index 50bffd6..dd9c662 100644
--- a/tests/check/rtp/conference.c
+++ b/tests/check/rtp/conference.c
@@ -136,13 +136,16 @@ _new_local_candidate (FsStream *stream, FsCandidate *candidate)
   GError *error = NULL;
   struct SimpleTestStream *other_st = find_pointback_stream (st->target,
       st->dat);
+  GList *candidates = NULL;
 
   g_debug ("%d:%d: Setting remote candidate for component %d",
       other_st->dat->id,
       other_st->target->id,
       candidate->component_id);
 
-  ret = fs_stream_add_remote_candidate (other_st->stream, candidate, &error);
+  candidates = g_list_prepend (NULL, candidate);
+  ret = fs_stream_set_remote_candidates (other_st->stream, candidates, &error);
+  g_list_free (candidates);
 
   if (error)
     ts_fail ("Error while adding candidate: (%s:%d) %s",
diff --git a/tests/check/rtp/sendcodecs.c b/tests/check/rtp/sendcodecs.c
index a2bd33b..7dc6dd5 100644
--- a/tests/check/rtp/sendcodecs.c
+++ b/tests/check/rtp/sendcodecs.c
@@ -234,7 +234,7 @@ one_way (GCallback havedata_handler, gpointer data)
   GError *error = NULL;
   gint port = 0;
   GstElement *recv_pipeline;
-  FsCandidate *candidate = NULL;
+  GList *candidates = NULL;
   GstBus *bus = NULL;
 
   loop = g_main_loop_new (NULL, FALSE);
@@ -266,14 +266,12 @@ one_way (GCallback havedata_handler, gpointer data)
 
   g_debug ("port is %d", port);
 
-  candidate = fs_candidate_new ("1", FS_COMPONENT_RTP, FS_CANDIDATE_TYPE_HOST,
-      FS_NETWORK_PROTOCOL_UDP, "127.0.0.1", port);
-
-  ts_fail_unless (fs_stream_add_remote_candidate (stream, candidate, &error),
+  candidates = g_list_prepend (NULL,
+      fs_candidate_new ("1", FS_COMPONENT_RTP, FS_CANDIDATE_TYPE_HOST,
+          FS_NETWORK_PROTOCOL_UDP, "127.0.0.1", port));
+  ts_fail_unless (fs_stream_set_remote_candidates (stream, candidates, &error),
       "Could not set remote candidate");
-  fs_stream_remote_candidates_added (stream);
-
-  fs_candidate_destroy (candidate);
+  fs_candidate_list_destroy (candidates);
 
   set_codecs (dat, stream);
 
-- 
1.5.6.5




More information about the farsight-commits mailing list