[farsight2/master] Add test for nice transmitter
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:26:14 PST 2008
---
.gitignore | 1 +
tests/check/Makefile.am | 14 +++++++
tests/check/transmitter/nice.c | 84 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+), 0 deletions(-)
create mode 100644 tests/check/transmitter/nice.c
diff --git a/.gitignore b/.gitignore
index 66af1a3..a993125 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 17220d8..70d2509 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 0000000..167980a
--- /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 at 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);
--
1.5.6.5
More information about the farsight-commits
mailing list