From: Tim-Philipp Müller Date: Tue, 27 Dec 2011 11:35:28 +0000 (+0000) Subject: tests: can't access private registry structure members directly any longer X-Git-Tag: RELEASE-0.11.2~272 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66eee8ae35ce47f750a83e1aa304ddec301a5940;p=platform%2Fupstream%2Fgstreamer.git tests: can't access private registry structure members directly any longer --- diff --git a/tests/check/gst/gstplugin.c b/tests/check/gst/gstplugin.c index 772a1b4..bce90a0 100644 --- a/tests/check/gst/gstplugin.c +++ b/tests/check/gst/gstplugin.c @@ -50,26 +50,35 @@ GST_END_TEST; GST_START_TEST (test_registry) { - GList *g; + GList *list, *g; GstRegistry *registry; registry = gst_registry_get_default (); - for (g = registry->plugins; g; g = g->next) { + list = gst_registry_get_plugin_list (registry); + for (g = list; g; g = g->next) { GstPlugin *plugin = GST_PLUGIN (g->data); - ASSERT_OBJECT_REFCOUNT (plugin, "plugin in registry", 1); + /* one for the registry, one for the list */ GST_DEBUG ("refcount %d %s", GST_OBJECT_REFCOUNT_VALUE (plugin), plugin->desc.name); + ASSERT_OBJECT_REFCOUNT (plugin, "plugin in registry", 2); + + gst_object_unref (plugin); } - for (g = registry->features; g; g = g->next) { + g_list_free (list); + + list = gst_registry_feature_filter (registry, NULL, FALSE, NULL); + for (g = list; g; g = g->next) { GstPluginFeature *feature = GST_PLUGIN_FEATURE (g->data); - fail_if (GST_OBJECT_REFCOUNT_VALUE (feature) != 1, - "Feature in registry should have refcount of 1"); + /* one for the registry, one for the list */ GST_DEBUG ("refcount %d %s", GST_OBJECT_REFCOUNT_VALUE (feature), GST_OBJECT_NAME (feature)); + ASSERT_OBJECT_REFCOUNT (feature, "feature in registry", 2); + gst_object_unref (feature); } + g_list_free (list); } GST_END_TEST;