From 25b21e82f5b1e67b2dc6f9b6a91e117b3676aeab Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 1 Jul 2002 10:41:39 +0000 Subject: [PATCH] fixing tests Original commit message from CVS: fixing tests --- tests/old/testsuite/Makefile.am | 8 +++++++- tests/old/testsuite/plugin/dynamic.c | 8 +++++++- tests/old/testsuite/plugin/loading.c | 15 +++++++++++++-- testsuite/Makefile.am | 8 +++++++- testsuite/plugin/dynamic.c | 8 +++++++- testsuite/plugin/loading.c | 15 +++++++++++++-- 6 files changed, 54 insertions(+), 8 deletions(-) diff --git a/tests/old/testsuite/Makefile.am b/tests/old/testsuite/Makefile.am index 906cfc2292..f3df9a92d4 100644 --- a/tests/old/testsuite/Makefile.am +++ b/tests/old/testsuite/Makefile.am @@ -4,9 +4,15 @@ SUBDIRS = caps cleanup plugin elements clock refcounting ## dynparams GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml +if BUILD_FAILING_TESTS testprogs = test_gst_init +inspectcheck = gst-inspect-check +else +testprogs = +inspectcheck = +endif -TESTS = $(top_builddir)/tools/gst-register $(testprogs) gst-inspect-check +TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck) check_PROGRAMS = $(testprogs) diff --git a/tests/old/testsuite/plugin/dynamic.c b/tests/old/testsuite/plugin/dynamic.c index df633ac51b..c94f5d5626 100644 --- a/tests/old/testsuite/plugin/dynamic.c +++ b/tests/old/testsuite/plugin/dynamic.c @@ -5,6 +5,7 @@ int main (int argc, char *argv[]) { GstPlugin *plugin; + GError *error = NULL; gboolean loaded; gst_init (&argc, &argv); @@ -12,7 +13,12 @@ main (int argc, char *argv[]) plugin = gst_plugin_new (".libs/libtestplugin.so"); g_assert (plugin != NULL); - loaded = gst_plugin_load_plugin (plugin); + loaded = gst_plugin_load_plugin (plugin, &error); + if (error) + { + g_print ("ERROR loading plug-in: %s\n", error->message); + g_free (error); + } g_assert (loaded == TRUE); g_print ("testplugin: %d, %s\n", loaded, plugin->name); diff --git a/tests/old/testsuite/plugin/loading.c b/tests/old/testsuite/plugin/loading.c index 148ce9be6c..aad2ddb21d 100644 --- a/tests/old/testsuite/plugin/loading.c +++ b/tests/old/testsuite/plugin/loading.c @@ -7,6 +7,7 @@ main (int argc, char *argv[]) GstPlugin *plugin; gboolean loaded = FALSE; gint numplugins; + GError *error = NULL; gst_init (&argc, &argv); @@ -22,7 +23,12 @@ main (int argc, char *argv[]) g_print ("testplugin: %p loaded: %s\n", plugin, (gst_plugin_is_loaded (plugin) ? "true": "false")); - loaded = gst_plugin_load_plugin (plugin); + loaded = gst_plugin_load_plugin (plugin, &error); + if (error) + { + g_print ("ERROR loading plug-in: %s\n", error->message); + g_free (error); + } g_assert (loaded == TRUE); numplugins = g_list_length (gst_registry_pool_plugin_list ()); @@ -36,7 +42,12 @@ main (int argc, char *argv[]) g_print ("%d features in plugin\n", g_list_length (gst_plugin_get_feature_list (plugin))); - loaded = gst_plugin_load_plugin (plugin); + loaded = gst_plugin_load_plugin (plugin, &error); + if (error) + { + g_print ("ERROR loading plug-in: %s\n", error->message); + g_free (error); + } g_assert (loaded == TRUE); numplugins = g_list_length (gst_registry_pool_plugin_list ()); diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 906cfc2292..f3df9a92d4 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -4,9 +4,15 @@ SUBDIRS = caps cleanup plugin elements clock refcounting ## dynparams GST_PLUGIN_PATH = $(shell cd $(top_builddir) && pwd) TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=`pwd`/test-registry.xml +if BUILD_FAILING_TESTS testprogs = test_gst_init +inspectcheck = gst-inspect-check +else +testprogs = +inspectcheck = +endif -TESTS = $(top_builddir)/tools/gst-register $(testprogs) gst-inspect-check +TESTS = $(top_builddir)/tools/gst-register $(testprogs) $(inspectcheck) check_PROGRAMS = $(testprogs) diff --git a/testsuite/plugin/dynamic.c b/testsuite/plugin/dynamic.c index df633ac51b..c94f5d5626 100644 --- a/testsuite/plugin/dynamic.c +++ b/testsuite/plugin/dynamic.c @@ -5,6 +5,7 @@ int main (int argc, char *argv[]) { GstPlugin *plugin; + GError *error = NULL; gboolean loaded; gst_init (&argc, &argv); @@ -12,7 +13,12 @@ main (int argc, char *argv[]) plugin = gst_plugin_new (".libs/libtestplugin.so"); g_assert (plugin != NULL); - loaded = gst_plugin_load_plugin (plugin); + loaded = gst_plugin_load_plugin (plugin, &error); + if (error) + { + g_print ("ERROR loading plug-in: %s\n", error->message); + g_free (error); + } g_assert (loaded == TRUE); g_print ("testplugin: %d, %s\n", loaded, plugin->name); diff --git a/testsuite/plugin/loading.c b/testsuite/plugin/loading.c index 148ce9be6c..aad2ddb21d 100644 --- a/testsuite/plugin/loading.c +++ b/testsuite/plugin/loading.c @@ -7,6 +7,7 @@ main (int argc, char *argv[]) GstPlugin *plugin; gboolean loaded = FALSE; gint numplugins; + GError *error = NULL; gst_init (&argc, &argv); @@ -22,7 +23,12 @@ main (int argc, char *argv[]) g_print ("testplugin: %p loaded: %s\n", plugin, (gst_plugin_is_loaded (plugin) ? "true": "false")); - loaded = gst_plugin_load_plugin (plugin); + loaded = gst_plugin_load_plugin (plugin, &error); + if (error) + { + g_print ("ERROR loading plug-in: %s\n", error->message); + g_free (error); + } g_assert (loaded == TRUE); numplugins = g_list_length (gst_registry_pool_plugin_list ()); @@ -36,7 +42,12 @@ main (int argc, char *argv[]) g_print ("%d features in plugin\n", g_list_length (gst_plugin_get_feature_list (plugin))); - loaded = gst_plugin_load_plugin (plugin); + loaded = gst_plugin_load_plugin (plugin, &error); + if (error) + { + g_print ("ERROR loading plug-in: %s\n", error->message); + g_free (error); + } g_assert (loaded == TRUE); numplugins = g_list_length (gst_registry_pool_plugin_list ());