mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
tests/save_and_load: Cleanups and leak fixing
This commit is contained in:
parent
ee0cf0b8aa
commit
afc400b31a
1 changed files with 8 additions and 12 deletions
|
@ -229,16 +229,8 @@ GST_END_TEST;
|
||||||
* information about the source line where the failing object was created.
|
* information about the source line where the failing object was created.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CMP_FAIL(obj, ...) \
|
#define CMP_FAIL(a, ...) \
|
||||||
{\
|
fail_unless (FALSE, __VA_ARGS__);
|
||||||
gchar *file, *func;\
|
|
||||||
guint line;\
|
|
||||||
file = g_object_get_data (G_OBJECT(obj), "file");\
|
|
||||||
func = g_object_get_data (G_OBJECT(obj), "function");\
|
|
||||||
line = GPOINTER_TO_UINT(g_object_get_data (G_OBJECT(obj), "line"));\
|
|
||||||
gst_debug_log (GST_CAT_DEFAULT, GST_LEVEL_ERROR, file, func,\
|
|
||||||
line, G_OBJECT(obj), __VA_ARGS__);\
|
|
||||||
}
|
|
||||||
|
|
||||||
/* compare two GObjects for equality. pointer identity and GType short-circuit
|
/* compare two GObjects for equality. pointer identity and GType short-circuit
|
||||||
* the comparison. If a and b are not identical pointers and of the same
|
* the comparison. If a and b are not identical pointers and of the same
|
||||||
|
@ -280,7 +272,8 @@ ges_objs_equal (GObject * a, GObject * b)
|
||||||
|
|
||||||
/* ignore name and layer properties */
|
/* ignore name and layer properties */
|
||||||
if (!g_strcmp0 ("name", (*iter)->name) ||
|
if (!g_strcmp0 ("name", (*iter)->name) ||
|
||||||
!g_strcmp0 ("layer", (*iter)->name))
|
!g_strcmp0 ("layer", (*iter)->name) ||
|
||||||
|
!g_strcmp0 ("parent", (*iter)->name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* special case caps property */
|
/* special case caps property */
|
||||||
|
@ -311,7 +304,7 @@ ges_objs_equal (GObject * a, GObject * b)
|
||||||
g_object_get_property (b, (*iter)->name, &bv);
|
g_object_get_property (b, (*iter)->name, &bv);
|
||||||
|
|
||||||
if (g_param_values_cmp (*iter, &av, &bv) != 0) {
|
if (g_param_values_cmp (*iter, &av, &bv) != 0) {
|
||||||
const gchar *a_str, *b_str;
|
gchar *a_str, *b_str;
|
||||||
|
|
||||||
a_str = gst_value_serialize (&av);
|
a_str = gst_value_serialize (&av);
|
||||||
b_str = gst_value_serialize (&bv);
|
b_str = gst_value_serialize (&bv);
|
||||||
|
@ -319,6 +312,9 @@ ges_objs_equal (GObject * a, GObject * b)
|
||||||
CMP_FAIL (b, "%s's %p and %p differ by property %s (%s != %s)",
|
CMP_FAIL (b, "%s's %p and %p differ by property %s (%s != %s)",
|
||||||
typename, a, b, (*iter)->name, a_str, b_str);
|
typename, a, b, (*iter)->name, a_str, b_str);
|
||||||
|
|
||||||
|
g_free (a_str);
|
||||||
|
g_free (b_str);
|
||||||
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue