tests: fix tests
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 17 May 2011 15:53:00 +0000 (17:53 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 17 May 2011 15:53:00 +0000 (17:53 +0200)
Remove the tests that handle incompatible formats, we don't want that anymore.

tests/check/gst/gstsegment.c

index 7970eb9..ca78aa0 100644 (file)
@@ -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);