From 7b8b93ad64ce5e15784f9099d450123d3182db11 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 17 May 2011 17:53:00 +0200 Subject: [PATCH] tests: fix tests Remove the tests that handle incompatible formats, we don't want that anymore. --- tests/check/gst/gstsegment.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/check/gst/gstsegment.c b/tests/check/gst/gstsegment.c index 7970eb9cc2..ca78aa09b0 100644 --- a/tests/check/gst/gstsegment.c +++ b/tests/check/gst/gstsegment.c @@ -455,10 +455,9 @@ GST_START_TEST (segment_seek_rate) gst_segment_init (&segment, GST_FORMAT_BYTES); - /* configure segment to rate 2.0, format does not matter when we don't specify - * a start or stop position. */ + /* configure segment to rate 2.0 */ gst_segment_do_seek (&segment, 2.0, - GST_FORMAT_UNDEFINED, + GST_FORMAT_BYTES, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_NONE, -1, &update); fail_unless (segment.format == GST_FORMAT_BYTES); @@ -467,6 +466,7 @@ GST_START_TEST (segment_seek_rate) fail_unless (segment.rate == 2.0); fail_unless (update == FALSE); +#if 0 /* 0 is the same in all formats and should not fail */ gst_segment_do_seek (&segment, 2.0, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, @@ -501,6 +501,7 @@ GST_START_TEST (segment_seek_rate) gst_segment_do_seek (&segment, 2.0, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_END, 0, &update); +#endif /* set a real stop position, this must happen in bytes */ gst_segment_do_seek (&segment, 3.0, @@ -515,6 +516,7 @@ GST_START_TEST (segment_seek_rate) * playback mode.*/ fail_unless (update == FALSE); +#if 0 /* 0 as relative end is fine too */ gst_segment_do_seek (&segment, 2.0, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, @@ -531,16 +533,16 @@ GST_START_TEST (segment_seek_rate) GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_SET, -1, &update); fail_unless (segment.stop == -1); +#endif /* set some duration, stop -1 END seeks will now work with the * duration, if the formats match */ segment.duration = 200; fail_unless (segment.duration == 200); - /* seek to end in any format with 0 should set the stop to the - * duration */ + /* seek to end with 0 should set the stop to the duration */ gst_segment_do_seek (&segment, 2.0, - GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, + GST_FORMAT_BYTES, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_END, 0, &update); fail_unless (segment.stop == 200); fail_unless (segment.duration == 200); @@ -571,6 +573,7 @@ GST_START_TEST (segment_seek_rate) gst_segment_do_seek (&segment, 2.0, GST_FORMAT_BYTES, GST_SEEK_FLAG_NONE, GST_SEEK_TYPE_CUR, -300, GST_SEEK_TYPE_END, 0, &update); + GST_DEBUG ("%" G_GINT64_FORMAT, segment.start); fail_unless (segment.start == 0); fail_unless (segment.stop == 200); fail_unless (segment.duration == 200);