summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2002-10-29 17:45:02 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2002-10-29 17:45:02 +0000
commitb60d8fe04c0b1c141b8fea6ca637c20f10f7f8e7 (patch)
tree135c21816f5e105e7cfd3ca07feb02e799de1a57 /testsuite
parentde8df7b9177ac7d71e1dbd6a227fa8bf9ae748ce (diff)
downloadgstreamer-b60d8fe04c0b1c141b8fea6ca637c20f10f7f8e7.tar.gz
mainloop test and some caps fixes that had to go in
Original commit message from CVS: mainloop test and some caps fixes that had to go in
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/caps/compatibility.c18
-rw-r--r--testsuite/refcounting/Makefile.am2
-rw-r--r--testsuite/refcounting/mainloop.c33
3 files changed, 43 insertions, 10 deletions
diff --git a/testsuite/caps/compatibility.c b/testsuite/caps/compatibility.c
index 88d9621931..932741f101 100644
--- a/testsuite/caps/compatibility.c
+++ b/testsuite/caps/compatibility.c
@@ -93,31 +93,31 @@ main (int argc, char *argv[])
gst_init (&argc, &argv);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (rawcaps));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (rawcaps));
g_print ("4 <-> 2 == %d (invalid, wrong major type)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (sinkcaps));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (mp1parsecaps), GST_CAPS_GET (sinkcaps));
g_print ("4 <-> 1 == %d (valid, subset)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (sinkcaps), GST_CAPS_GET (mp1parsecaps));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (sinkcaps), GST_CAPS_GET (mp1parsecaps));
g_print ("1 <-> 4 == %d (invalid, superset)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps2));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps2));
g_print ("2 <-> 3 == %d (invalid, ranges)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps3));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps3));
g_print ("2 <-> 5 == %d (valid)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps3), GST_CAPS_GET (rawcaps));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps3), GST_CAPS_GET (rawcaps));
g_print ("5 <-> 2 == %d (invalid)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps3));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps3));
g_print ("3 <-> 5 == %d (valid)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps2), GST_CAPS_GET (rawcaps));
g_print ("3 <-> 2 == %d (invalid, property missing in source)\n", testret);
- testret = gst_caps_check_compatibility (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps));
+ testret = gst_caps_is_always_compatible (GST_CAPS_GET (rawcaps), GST_CAPS_GET (rawcaps));
g_print ("2 <-> 2 == %d (valid, same caps)\n", testret);
return 0;
diff --git a/testsuite/refcounting/Makefile.am b/testsuite/refcounting/Makefile.am
index 551ebafbb2..e4024be96f 100644
--- a/testsuite/refcounting/Makefile.am
+++ b/testsuite/refcounting/Makefile.am
@@ -3,7 +3,7 @@ tests_failing = element bin element_pad pad
else
tests_failing =
endif
-tests_working =
+tests_working = mainloop
element_SOURCES = element.c mem.c
pad_SOURCES = pad.c mem.c
diff --git a/testsuite/refcounting/mainloop.c b/testsuite/refcounting/mainloop.c
new file mode 100644
index 0000000000..1400d88c33
--- /dev/null
+++ b/testsuite/refcounting/mainloop.c
@@ -0,0 +1,33 @@
+#include <gst/gst.h>
+
+/* test to make sure that we can do gst_main and gst_main_quit in succession */
+/* FIXME: use mutexes */
+
+gboolean mainloop = FALSE;
+
+static gboolean
+quit_main (gpointer data)
+{
+ if (mainloop)
+ {
+ mainloop = FALSE;
+ g_print ("-");
+ gst_main_quit ();
+ }
+ return TRUE;
+}
+
+int
+main (int argc, gchar *argv[])
+{
+ int i;
+
+ g_timeout_add (10, quit_main, NULL);
+ for (i = 0; i < 1000; ++i)
+ {
+ mainloop = TRUE;
+ g_print ("+");
+ gst_main ();
+ }
+ return 0;
+}