[farsight2/master] Add base of upnp library test

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


---
 .gitignore                |    1 +
 tests/check/Makefile.am   |   14 ++++++++++-
 tests/check/upnp/fsupnp.c |   56 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletions(-)
 create mode 100644 tests/check/upnp/fsupnp.c

diff --git a/.gitignore b/.gitignore
index da3a337..3a08142 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,7 @@ tests/check/rtp/conference
 tests/check/rtp/codecs
 tests/check/rtp/sendcodecs
 tests/check/utils/binadded
+tests/check/upnp/fsupnp
 tests/rtp/codec-discovery
 tests/commandline/simple-call
 tests/upnp/test
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index e6db1e5..7d6c0b3 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -39,7 +39,8 @@ check_PROGRAMS = \
 	rtp/codecs \
 	rtp/sendcodecs \
 	rtp/conference \
-	utils/binadded
+	utils/binadded \
+	upnp/fsupnp
 
 
 AM_CFLAGS = \
@@ -92,3 +93,14 @@ utils_binadded_CFLAGS = $(AM_CFLAGS)
 utils_binadded_SOURCES = \
 	utils/binadded.c
 
+if HAVE_GUPNP
+
+upnp_fsupnp_CFLAGS = $(AM_CFLAGS)
+upnp_fsupnp_LDADD = $(LDADD) \
+	$(top_builddir)/gst-libs/ext/fsupnp/libfsupnp.la
+
+endif
+
+
+upnp_fsupnp_SOURCES = \
+	upnp/fsupnp.c
diff --git a/tests/check/upnp/fsupnp.c b/tests/check/upnp/fsupnp.c
new file mode 100644
index 0000000..0aadd93
--- /dev/null
+++ b/tests/check/upnp/fsupnp.c
@@ -0,0 +1,56 @@
+/* Farsigh2 unit tests for FsCodec
+ *
+ * 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 <ext/fsupnp/fs-upnp-simple-igd.h>
+#include <ext/fsupnp/fs-upnp-simple-igd-thread.h>
+
+
+
+GST_START_TEST (test_fsupnp_new)
+{
+  FsUpnpSimpleIgd *igd = fs_upnp_simple_igd_new (NULL);
+  FsUpnpSimpleIgdThread *igdthread = fs_upnp_simple_igd_thread_new ();
+  FsUpnpSimpleIgdThread *igdthread1 = fs_upnp_simple_igd_thread_new ();
+
+  g_object_unref (igd);
+  g_object_unref (igdthread);
+  g_object_unref (igdthread1);
+}
+GST_END_TEST;
+
+static Suite *
+fsupnp_suite (void)
+{
+  Suite *s = suite_create ("fsupnp");
+  TCase *tc_chain = tcase_create ("fsupnp");
+
+  suite_add_tcase (s, tc_chain);
+
+  tcase_add_test (tc_chain, test_fsupnp_new);
+
+  return s;
+}
+
+GST_CHECK_MAIN (fsupnp);
-- 
1.5.6.5




More information about the farsight-commits mailing list