From 868538945b2770d2d719afa608dcc535e39a7b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 11 Aug 2009 13:03:03 +0200 Subject: [PATCH] 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. --- tests/check/gst/gstsegment.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/check/gst/gstsegment.c b/tests/check/gst/gstsegment.c index 2ac8423393..ec370651ab 100644 --- a/tests/check/gst/gstsegment.c +++ b/tests/check/gst/gstsegment.c @@ -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,