[farsight2/master] Add stund based test

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


---
 tests/check/transmitter/nice.c |   46 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c
index 96734c6..279a85c 100644
--- a/tests/check/transmitter/nice.c
+++ b/tests/check/transmitter/nice.c
@@ -26,6 +26,8 @@
 #include <gst/farsight/fs-transmitter.h>
 #include <gst/farsight/fs-conference-iface.h>
 
+#include <unistd.h>
+
 #include "check-threadsafe.h"
 #include "generic.h"
 
@@ -469,8 +471,6 @@ GST_START_TEST (test_nicetransmitter_no_associate_on_source)
 }
 GST_END_TEST;
 
-
-
 GST_START_TEST (test_nicetransmitter_preferred_candidates)
 {
   GParameter param = {NULL, {0}};
@@ -498,6 +498,44 @@ GST_START_TEST (test_nicetransmitter_preferred_candidates)
 GST_END_TEST;
 
 
+
+GST_START_TEST (test_nicetransmitter_stund)
+{
+  GError *error = NULL;
+  gint myout, myin;
+  GPid pid;
+  gchar *argv[] = {"stund", NULL};
+  GParameter params[2];
+
+  if (!g_spawn_async_with_pipes (NULL, argv, NULL,
+          G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &myin, &myout, NULL,
+          &error))
+  {
+    g_debug ("Could not spawn stund, skipping stun testing: %s",
+        error->message);
+    g_clear_error (&error);
+    return;
+  }
+
+  memset (params, 0, sizeof (GParameter) * 2);
+
+  params[0].name = "stun-ip";
+  g_value_init (&params[0].value, G_TYPE_STRING);
+  g_value_set_static_string (&params[0].value, "127.0.0.1");
+
+  params[1].name = "stun-port";
+  g_value_init (&params[1].value, G_TYPE_UINT);
+  g_value_set_uint (&params[1].value, 3478);
+
+  run_nice_transmitter_test (2, params, 0);
+
+  close (myout);
+  close (myin);
+  g_spawn_close_pid (pid);
+}
+GST_END_TEST;
+
+
 static Suite *
 nicetransmitter_suite (void)
 {
@@ -525,6 +563,10 @@ nicetransmitter_suite (void)
   tcase_add_test (tc_chain, test_nicetransmitter_preferred_candidates);
   suite_add_tcase (s, tc_chain);
 
+  tc_chain = tcase_create ("nicetransmitter-stund");
+  tcase_add_test (tc_chain, test_nicetransmitter_stund);
+  suite_add_tcase (s, tc_chain);
+
   return s;
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list