From: Nicolas Dufresne Date: Thu, 26 May 2016 18:43:10 +0000 (-0400) Subject: object: Add _set_name() test on parented object X-Git-Tag: 1.10.4~235 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=850510f9e8d9f8356f9f9d9f50333f322615df47;p=platform%2Fupstream%2Fgstreamer.git object: Add _set_name() test on parented object This is not allowed, and set_name() should fail. https://bugzilla.gnome.org/show_bug.cgi?id=766923 --- diff --git a/tests/check/gst/gstobject.c b/tests/check/gst/gstobject.c index 4f166af..d7f00cc 100644 --- a/tests/check/gst/gstobject.c +++ b/tests/check/gst/gstobject.c @@ -95,7 +95,7 @@ notify_name (GObject * object, GParamSpec * pspec, gint * out_count) /* GstFakeObject name tests */ GST_START_TEST (test_fake_object_name) { - GstObject *object; + GstObject *object, *parent; gint count = 0; gchar *name; gchar *name2; @@ -135,7 +135,13 @@ GST_START_TEST (test_fake_object_name) g_free (name); g_free (name2); - gst_object_unref (object); + /* add a parent and ensure name cannot be changed */ + parent = g_object_new (gst_fake_object_get_type (), NULL); + gst_object_set_parent (object, parent); + fail_if (gst_object_set_name (object, "broken"), + "Could set name on parented object"); + + gst_object_unref (parent); } GST_END_TEST;