From: Vivia Nikolaidou Date: Wed, 2 Sep 2015 14:38:25 +0000 (+0300) Subject: segment: Added unit tests for gst_segment_position_from_stream_time X-Git-Tag: 1.10.4~774 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=572c7c6b9a0d5d52062a8523ad0b26712b726994;p=platform%2Fupstream%2Fgstreamer.git segment: Added unit tests for gst_segment_position_from_stream_time --- diff --git a/tests/check/gst/gstsegment.c b/tests/check/gst/gstsegment.c index 8678915..5e1b30e 100644 --- a/tests/check/gst/gstsegment.c +++ b/tests/check/gst/gstsegment.c @@ -26,7 +26,7 @@ static void check_times (GstSegment * segment, guint64 position, guint64 stream_time, guint64 running_time) { - guint64 st, rt; + guint64 st, rt, pos; st = gst_segment_to_stream_time (segment, segment->format, position); rt = gst_segment_to_running_time (segment, segment->format, position); @@ -35,6 +35,10 @@ check_times (GstSegment * segment, guint64 position, guint64 stream_time, fail_unless_equals_int64 (st, stream_time); fail_unless_equals_int64 (rt, running_time); + if (stream_time != -1) { + pos = gst_segment_position_from_stream_time (segment, segment->format, st); + fail_unless_equals_int64 (pos, position); + } } /* mess with the segment structure in the bytes format */