From 66eee8ae35ce47f750a83e1aa304ddec301a5940 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 27 Dec 2011 11:35:28 +0000 Subject: [PATCH] tests: can't access private registry structure members directly any longer --- tests/check/gst/gstplugin.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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; -- 2.7.4