diff --git a/tests/old/testsuite/caps/compatibility.c b/tests/old/testsuite/caps/compatibility.c index 88d9621931..932741f101 100644 --- a/tests/old/testsuite/caps/compatibility.c +++ b/tests/old/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/tests/old/testsuite/refcounting/Makefile.am b/tests/old/testsuite/refcounting/Makefile.am index 551ebafbb2..e4024be96f 100644 --- a/tests/old/testsuite/refcounting/Makefile.am +++ b/tests/old/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/tests/old/testsuite/refcounting/mainloop.c b/tests/old/testsuite/refcounting/mainloop.c new file mode 100644 index 0000000000..1400d88c33 --- /dev/null +++ b/tests/old/testsuite/refcounting/mainloop.c @@ -0,0 +1,33 @@ +#include + +/* 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; +} 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 + +/* 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; +}