From: <bi...@ke...> - 2006-04-04 11:16:58
|
CVS Root: /cvs/gstreamer Module: gnonlin Changes by: bilboed Date: Tue Apr 04 2006 11:16:53 UTC Log message: * tests/check/simple.c: (GST_START_TEST), (gnonlin_suite): Added new test to check start/duration/stop correctness for sources and compositions. Modified files: . : ChangeLog tests/check : simple.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/ChangeLog.diff?r1=1.85&r2=1.86 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gnonlin/tests/check/simple.c.diff?r1=1.6&r2=1.7 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gnonlin/ChangeLog,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- ChangeLog 4 Apr 2006 10:54:10 -0000 1.85 +++ ChangeLog 4 Apr 2006 11:16:41 -0000 1.86 @@ -1,5 +1,11 @@ 2006-04-04 Edward Hervey <ed...@fl...> + * tests/check/simple.c: (GST_START_TEST), (gnonlin_suite): + Added new test to check start/duration/stop correctness for + sources and compositions. + +2006-04-04 Edward Hervey <ed...@fl...> * gnl/gnlobject.c: (gnl_object_remove_ghost_pad): Free the GnlPadPrivate once we have removed the pad. Index: simple.c RCS file: /cvs/gstreamer/gnonlin/tests/check/simple.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- simple.c 4 Apr 2006 09:29:58 -0000 1.6 +++ simple.c 4 Apr 2006 11:16:41 -0000 1.7 @@ -143,6 +143,60 @@ fail_if (duration != durval); \ } +GST_START_TEST (test_time_duration) +{ + guint64 start, stop; + gint64 duration; + GstElement *comp, *source1, *source2; + comp = gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); + /* + Source 1 + Start : 0s + Duration : 2s + Priority : 1 + */ + source1 = videotest_gnl_src ("source1", 0, 1 * GST_SECOND, 1, 1); + fail_if (source1 == NULL); + check_start_stop_duration(source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); + Source 2 + Start : 2s + source2 = videotest_gnl_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2, 1); + fail_if (source2 == NULL); + check_start_stop_duration(source2, 1 * GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND); + /* Add one source */ + gst_bin_add (GST_BIN (comp), source1); + check_start_stop_duration(comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); + /* Second source */ + gst_bin_add (GST_BIN (comp), source2); + check_start_stop_duration(comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); + /* Remove second source */ + gst_object_ref (source1); + gst_bin_remove (GST_BIN (comp), source1); + check_start_stop_duration(comp, 1 * GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND); + /* Re-add second source */ +} +GST_END_TEST; GST_START_TEST (test_one_after_other) { GstElement *pipeline; @@ -584,6 +638,8 @@ suite_add_tcase (s, tc_chain); + tcase_add_test (tc_chain, test_time_duration); /* Only add the following test for core > 0.10.4 */ gst_version (&major, &minor, µ, &nano); if ((micro > 4) || (micro == 4 && nano > 0)) { |