GESSimpleTimelineLayer: add test for _nth() method
authorBrandon Lewis <brandon@collabora.co.uk>
Wed, 15 Dec 2010 15:50:44 +0000 (15:50 +0000)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 15 Dec 2010 17:01:33 +0000 (18:01 +0100)
tests/check/ges/simplelayer.c

index c1639b6..40f6c9a 100644 (file)
@@ -66,6 +66,7 @@ GST_START_TEST (test_gsl_add)
   GESTimelineLayer *layer;
   GESTrack *track;
   GESCustomTimelineSource *source;
+  GESTimelineObject *source2;
 
   ges_init ();
   /* This is the simplest scenario ever */
@@ -90,6 +91,15 @@ GST_START_TEST (test_gsl_add)
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (source), GST_SECOND);
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_START (source), 0);
 
+  /* test nth */
+  source2 =
+      ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, -1);
+  fail_if (source2);
+  source2 = ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, 2);
+  fail_if (source2);
+  source2 = ges_simple_timeline_layer_nth ((GESSimpleTimelineLayer *) layer, 0);
+  fail_unless ((GESTimelineObject *) source == source2);
+
   fail_unless (ges_timeline_layer_remove_object (layer,
           GES_TIMELINE_OBJECT (source)));
   fail_unless (ges_timeline_remove_track (timeline, track));