summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-04-24 18:27:32 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-11-03 17:05:29 -0500
commit383b4e8a3a19a90a3a257420e6c8676ac69ebd3d (patch)
tree113ffde7e84cc2cd35aafda62c7ad34a03fa6dc6
parentb37b852168594a0b1cae21b51c2e780e678eddc9 (diff)
downloadfarstream-383b4e8a3a19a90a3a257420e6c8676ac69ebd3d.tar.gz
Add test for nice transmitter
-rw-r--r--.gitignore1
-rw-r--r--tests/check/Makefile.am14
-rw-r--r--tests/check/transmitter/nice.c84
3 files changed, 99 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 66af1a3b..a9931257 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,6 +71,7 @@ tests/check/base/fscodec
tests/check/base/fstransmitter
tests/check/transmitter/rawudp
tests/check/transmitter/multicast
+tests/check/transmitter/nice
tests/check/rtp/conference
tests/check/rtp/codecs
tests/check/rtp/sendcodecs
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index 17220d8b..70d2509b 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -34,6 +34,12 @@ EXTRA_DIST = \
upnp/WANIPConnection.xml \
base/tests1.conf
+if USE_NICE
+NICE_TRANSMITTER = transmitter/nice
+else
+NICE_TRANSMITTER =
+endif
+
#######
# From here.. Its a list of our tests and their sub stuff
#
@@ -42,6 +48,7 @@ check_PROGRAMS = \
base/fstransmitter \
transmitter/rawudp \
transmitter/multicast \
+ $(NICE_TRANSMITTER) \
rtp/codecs \
rtp/sendcodecs \
rtp/conference \
@@ -78,6 +85,13 @@ transmitter_multicast_SOURCES = \
transmitter/generic.h \
transmitter/multicast.c
+transmitter_nice_CFLAGS = $(FS2_INTERNAL_CFLAGS) $(CFLAGS) $(AM_CFLAGS)
+transmitter_nice_SOURCES = \
+ check-threadsafe.h \
+ transmitter/generic.c \
+ transmitter/generic.h \
+ transmitter/nice.c
+
rtp_conference_CFLAGS = $(AM_CFLAGS)
rtp_conference_SOURCES = \
check-threadsafe.h \
diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c
new file mode 100644
index 00000000..167980ab
--- /dev/null
+++ b/tests/check/transmitter/nice.c
@@ -0,0 +1,84 @@
+/* Farsight 2 unit tests for FsRawUdpTransmitter
+ *
+ * Copyright (C) 2007 Collabora, Nokia
+ * @author: Olivier Crete <olivier.crete@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gst/check/gstcheck.h>
+#include <gst/farsight/fs-transmitter.h>
+#include <gst/farsight/fs-conference-iface.h>
+
+#include "check-threadsafe.h"
+#include "generic.h"
+
+
+GST_START_TEST (test_nicetransmitter_new)
+{
+ GError *error = NULL;
+ FsTransmitter *trans;
+ GstElement *pipeline;
+ GstElement *trans_sink, *trans_src;
+
+ trans = fs_transmitter_new ("nice", 2, &error);
+
+ if (error) {
+ ts_fail ("Error creating transmitter: (%s:%d) %s",
+ g_quark_to_string (error->domain), error->code, error->message);
+ }
+
+ ts_fail_if (trans == NULL, "No transmitter create, yet error is still NULL");
+
+ pipeline = setup_pipeline (trans, NULL);
+
+ g_object_get (trans, "gst-sink", &trans_sink, "gst-src", &trans_src, NULL);
+
+ fail_if (trans_sink == NULL, "Sink is NULL");
+ fail_if (trans_src == NULL, "Src is NULL");
+
+ gst_object_unref (trans_sink);
+ gst_object_unref (trans_src);
+
+ g_object_unref (trans);
+
+ gst_object_unref (pipeline);
+
+}
+GST_END_TEST;
+static Suite *
+nicetransmitter_suite (void)
+{
+ Suite *s = suite_create ("nicetransmitter");
+ TCase *tc_chain;
+ GLogLevelFlags fatal_mask;
+
+ fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
+ fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
+ g_log_set_always_fatal (fatal_mask);
+
+ tc_chain = tcase_create ("nicetransmitter");
+ tcase_set_timeout (tc_chain, 5);
+ tcase_add_test (tc_chain, test_nicetransmitter_new);
+ suite_add_tcase (s, tc_chain);
+ return s;
+}
+
+
+GST_CHECK_MAIN (nicetransmitter);