gstsegment: Fix unit test and add an additional test

The previous test assumed that start=stop=segment_start will
be inside the segment but this is wrong.
This commit is contained in:
Sebastian Dröge 2009-08-11 13:03:03 +02:00
parent ca8a0376c5
commit 868538945b

View file

@ -73,12 +73,17 @@ GST_START_TEST (segment_seek_nosize)
fail_unless (cstart == 100);
fail_unless (cstop == 150);
/* special case, 0 duration */
/* special case, 0 duration and touching lower bound */
res = gst_segment_clip (&segment, GST_FORMAT_BYTES,
100, 100, &cstart, &cstop);
fail_unless (res == FALSE);
/* special case, 0 duration and inside the segment */
res = gst_segment_clip (&segment, GST_FORMAT_BYTES,
120, 120, &cstart, &cstop);
fail_unless (res == TRUE);
fail_unless (cstart == 100);
fail_unless (cstop == 100);
fail_unless (cstart == 120);
fail_unless (cstop == 120);
/* completely inside */
res = gst_segment_clip (&segment, GST_FORMAT_BYTES,