[farsight2/master] Test setting a static codec without its clock-rate

Olivier Crête olivier.crete at collabora.co.uk
Thu Jan 15 11:48:24 PST 2009


---
 tests/check/rtp/codecs.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/tests/check/rtp/codecs.c b/tests/check/rtp/codecs.c
index e57ee8b..cf1fc29 100644
--- a/tests/check/rtp/codecs.c
+++ b/tests/check/rtp/codecs.c
@@ -265,6 +265,7 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
   fail_unless (fs_codec_are_equal (codecs->data, codecs2->data),
       "Negotiated codec does not match remote codec");
   fs_codec_list_destroy (codecs2);
+  codecs2 = NULL;
 
   has_negotiated = FALSE;
 
@@ -278,6 +279,32 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
   fs_codec_list_destroy (codecs);
   codecs = NULL;
 
+  codecs = g_list_append (NULL,
+      fs_codec_new (
+          0,
+          "PCMU",
+          FS_MEDIA_TYPE_AUDIO,
+          0));
+
+  has_negotiated = FALSE;
+  fail_unless (fs_stream_set_remote_codecs (st->stream, codecs, &error),
+      "Could not set remote PCMU codec with clock rate 0");
+  g_clear_error (&error);
+
+  fail_unless (has_negotiated == TRUE,
+      "Did not receive the notify::codecs signal");
+
+  ((FsCodec*)codecs->data)->clock_rate = 8000;
+
+  g_object_get (dat->session, "codecs", &codecs2, NULL);
+  fail_unless (g_list_length (codecs2) == 1, "Too many negotiated codecs");
+  fail_unless (fs_codec_are_equal (codecs->data, codecs2->data),
+      "Negotiated codec does not match remote codec");
+  fs_codec_list_destroy (codecs2);
+
+  fs_codec_list_destroy (codecs);
+  codecs = NULL;
+
   cleanup_simple_conference (dat);
 }
 GST_END_TEST;
-- 
1.5.6.5




More information about the farsight-commits mailing list