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
This commit is contained in:
Nicolas Dufresne 2016-05-26 14:43:10 -04:00
parent 1a5f79981c
commit 850510f9e8

View file

@ -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;