tests/check/ges/{simplelayer.c,transition.c}: update unit tests
authorBrandon Lewis <brandon.lewis@collabora.co.uk>
Thu, 3 Jun 2010 17:04:11 +0000 (19:04 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 9 Jun 2010 09:28:11 +0000 (11:28 +0200)
tests/check/ges/simplelayer.c
tests/check/ges/transition.c

index 92eb9f3523a4f723edd475013ec814d0e4fe7959..9d735446be923fb215598d291adfd7b846d6541d 100644 (file)
@@ -216,23 +216,23 @@ GST_START_TEST (test_gsl_with_transitions)
 #define HALF_SECOND ((guint64) (0.5 * GST_SECOND))
 #define SECOND(a) ((guint64) (a * GST_SECOND))
 
-  tr1 = ges_timeline_transition_new (0);
+  tr1 = ges_timeline_transition_new (VTYPE_CROSSFADE);
   g_object_set (tr1, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr1), HALF_SECOND);
 
-  tr2 = ges_timeline_transition_new (0);
+  tr2 = ges_timeline_transition_new (VTYPE_CROSSFADE);
   g_object_set (tr2, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr2), HALF_SECOND);
 
-  tr3 = ges_timeline_transition_new (0);
+  tr3 = ges_timeline_transition_new (VTYPE_CROSSFADE);
   g_object_set (tr3, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr3), HALF_SECOND);
 
-  tr4 = ges_timeline_transition_new (0);
+  tr4 = ges_timeline_transition_new (VTYPE_CROSSFADE);
   g_object_set (tr4, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr4), HALF_SECOND);
 
-  tr5 = ges_timeline_transition_new (0);
+  tr5 = ges_timeline_transition_new (VTYPE_CROSSFADE);
   g_object_set (tr5, "duration", HALF_SECOND, "start", (guint64) 42, NULL);
   fail_unless_equals_uint64 (GES_TIMELINE_OBJECT_DURATION (tr5), HALF_SECOND);
 
index 8457c0e0a061175f40756ce4b90ad0b621a258ea..2a76b9a87450cca86fffb4d1be9ecebf111b671f 100644 (file)
@@ -37,9 +37,9 @@ GST_START_TEST (test_transition_basic)
   track = ges_track_video_raw_new ();
   fail_unless (track != 0);
 
-  tr1 = ges_timeline_transition_new (0);
+  tr1 = ges_timeline_transition_new (VTYPE_CROSSFADE);
   fail_unless (tr1 != 0);
-  fail_unless (tr1->vtype == 0);
+  fail_unless (tr1->vtype == VTYPE_CROSSFADE);
 
   tr2 = ges_timeline_transition_new_for_nick ("bar-wipe-lr");
   fail_unless (tr2 != 0);
@@ -50,7 +50,7 @@ GST_START_TEST (test_transition_basic)
       ges_timeline_object_create_track_object (GES_TIMELINE_OBJECT (tr2),
       track);
 
-  fail_unless (trackobject != 0);
+  fail_unless (trackobject != NULL);
   fail_unless (GES_TRACK_TRANSITION (trackobject)->vtype == 1);
 
   g_object_unref (trackobject);
@@ -84,7 +84,7 @@ GST_START_TEST (test_transition_properties)
 
   ges_init ();
 
-  object = GES_TIMELINE_OBJECT (ges_timeline_transition_new (0));
+  object = GES_TIMELINE_OBJECT (ges_timeline_transition_new (VTYPE_CROSSFADE));
 
   track = ges_track_video_raw_new ();
   fail_unless (track != NULL);
@@ -130,18 +130,20 @@ GST_START_TEST (test_transition_properties)
 
   /* test changing vtype */
 
-  g_object_set (object, "vtype", 0, NULL);
-  assert_equals_int (GES_TIMELINE_TRANSITION (object)->vtype, 0);
-  assert_equals_int (GES_TRACK_TRANSITION (trackobject)->vtype, 0);
+  g_object_set (object, "vtype", VTYPE_CROSSFADE, NULL);
+  assert_equals_int (GES_TIMELINE_TRANSITION (object)->vtype, VTYPE_CROSSFADE);
+  assert_equals_int (GES_TRACK_TRANSITION (trackobject)->vtype,
+      VTYPE_CROSSFADE);
   g_object_set (object, "vtype", 1, NULL);
   assert_equals_int (GES_TIMELINE_TRANSITION (object)->vtype, 1);
   assert_equals_int (GES_TRACK_TRANSITION (trackobject)->vtype, 1);
   g_object_set (object, "vtype", 8, NULL);
   assert_equals_int (GES_TIMELINE_TRANSITION (object)->vtype, 8);
   assert_equals_int (GES_TRACK_TRANSITION (trackobject)->vtype, 8);
-  g_object_set (object, "vtype", 0, NULL);
-  assert_equals_int (GES_TIMELINE_TRANSITION (object)->vtype, 0);
-  assert_equals_int (GES_TRACK_TRANSITION (trackobject)->vtype, 0);
+  g_object_set (object, "vtype", VTYPE_CROSSFADE, NULL);
+  assert_equals_int (GES_TIMELINE_TRANSITION (object)->vtype, VTYPE_CROSSFADE);
+  assert_equals_int (GES_TRACK_TRANSITION (trackobject)->vtype,
+      VTYPE_CROSSFADE);
 
   ges_timeline_object_release_track_object (object, trackobject);