checks: don't assume element factory is not loaded yet
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Jul 2010 13:04:32 +0000 (14:04 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Jul 2010 13:11:32 +0000 (14:11 +0100)
It may already be loaded if check is being run with CK_FORK=no.

See #623469.

tests/check/gst/gstelement.c

index 3ec98e6..9544b6d 100644 (file)
@@ -175,10 +175,13 @@ GST_START_TEST (test_class)
   factory = gst_element_factory_find ("queue");
   fail_if (factory == NULL);
 
-  GST_DEBUG ("getting the type");
-  /* feature is not loaded, should return 0 as the type */
-  type = gst_element_factory_get_element_type (factory);
-  fail_if (type != 0);
+  /* it may already be loaded if check is being run with CK_FORK=no */
+  if (!GST_PLUGIN_FEATURE (factory)->loaded) {
+    GST_DEBUG ("getting the type");
+    /* feature is not loaded, should return 0 as the type */
+    type = gst_element_factory_get_element_type (factory);
+    fail_if (type != 0);
+  }
 
   GST_DEBUG ("now loading the plugin");
   tmp =