mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
test:basic: Do not add useless references, and minor improvements
This commit is contained in:
parent
134ce9a8d8
commit
15c1481a56
1 changed files with 17 additions and 22 deletions
|
@ -463,13 +463,11 @@ GST_START_TEST (test_ges_timeline_remove_track)
|
|||
* 1 by the timeline */
|
||||
ASSERT_OBJECT_REFCOUNT (GES_TRACK_ELEMENT (tmp->data), "trackelement", 3);
|
||||
}
|
||||
gst_object_ref (t1);
|
||||
/* There are 3 references held:
|
||||
* 1 by the container
|
||||
* 1 by the track
|
||||
* 1 by the timeline
|
||||
* 1 added by ourselves above (gst_object_ref (t1)) */
|
||||
ASSERT_OBJECT_REFCOUNT (t1, "trackelement", 4);
|
||||
* 1 by the timeline */
|
||||
ASSERT_OBJECT_REFCOUNT (t1, "trackelement", 3);
|
||||
|
||||
trackelements = GES_CONTAINER_CHILDREN (s2);
|
||||
fail_unless (trackelements != NULL);
|
||||
|
@ -481,13 +479,11 @@ GST_START_TEST (test_ges_timeline_remove_track)
|
|||
* 1 by the timeline */
|
||||
ASSERT_OBJECT_REFCOUNT (GES_TRACK_ELEMENT (tmp->data), "trackelement", 3);
|
||||
}
|
||||
gst_object_ref (t2);
|
||||
/* There are 3 references held:
|
||||
* 1 by the container
|
||||
* 1 by the track
|
||||
* 1 by the timeline
|
||||
* 1 added by ourselves above (gst_object_ref (t2)) */
|
||||
ASSERT_OBJECT_REFCOUNT (t2, "t2", 4);
|
||||
* 1 by the timeline */
|
||||
ASSERT_OBJECT_REFCOUNT (t2, "t2", 3);
|
||||
|
||||
trackelements = GES_CONTAINER_CHILDREN (s3);
|
||||
fail_unless (trackelements != NULL);
|
||||
|
@ -499,29 +495,28 @@ GST_START_TEST (test_ges_timeline_remove_track)
|
|||
* 1 by the timeline */
|
||||
ASSERT_OBJECT_REFCOUNT (GES_TRACK_ELEMENT (tmp->data), "trackelement", 3);
|
||||
}
|
||||
gst_object_ref (t3);
|
||||
/* There are 3 references held:
|
||||
* 1 by the container
|
||||
* 1 by the track
|
||||
* 1 by the timeline
|
||||
* 1 added by ourselves above (gst_object_ref (t3)) */
|
||||
ASSERT_OBJECT_REFCOUNT (t3, "t3", 4);
|
||||
* 1 by the timeline */
|
||||
ASSERT_OBJECT_REFCOUNT (t3, "t3", 3);
|
||||
|
||||
/* remove the track and check that the track elements have been released */
|
||||
fail_unless (ges_timeline_remove_track (timeline, track));
|
||||
|
||||
ASSERT_OBJECT_REFCOUNT (t1, "trackelement", 3);
|
||||
ASSERT_OBJECT_REFCOUNT (t2, "trackelement", 3);
|
||||
ASSERT_OBJECT_REFCOUNT (t3, "trackelement", 3);
|
||||
|
||||
gst_object_unref (t1);
|
||||
gst_object_unref (t2);
|
||||
gst_object_unref (t3);
|
||||
ASSERT_OBJECT_REFCOUNT (t1, "trackelement", 2);
|
||||
ASSERT_OBJECT_REFCOUNT (t2, "trackelement", 2);
|
||||
ASSERT_OBJECT_REFCOUNT (t3, "trackelement", 2);
|
||||
ASSERT_OBJECT_REFCOUNT (layer, "1 for the timeline", 1);
|
||||
ASSERT_OBJECT_REFCOUNT (timeline, "1 for the us", 1);
|
||||
tmp = ges_timeline_layer_get_clips (layer);
|
||||
assert_equals_int (g_list_length (tmp), 3);
|
||||
|
||||
gst_object_unref (timeline);
|
||||
ASSERT_OBJECT_REFCOUNT (t1, "trackelement", 0);
|
||||
ASSERT_OBJECT_REFCOUNT (t2, "trackelement", 0);
|
||||
ASSERT_OBJECT_REFCOUNT (t3, "trackelement", 0);
|
||||
fail_if (G_IS_OBJECT (layer));
|
||||
fail_if (G_IS_OBJECT (t1));
|
||||
fail_if (G_IS_OBJECT (t2));
|
||||
fail_if (G_IS_OBJECT (t3));
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
|
Loading…
Reference in a new issue