mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
check: hlsdemux: make duration unit test robust to floating point rounding
The test_playlist_with_doubles_duration() test fails on some platforms due to rounding errors that occur when m3u8.c converts from the floating point value in the HLS manifest to a GstClockTime. Using assert_equals_float() fixes this because this function handles the rounding error issues by accepting almost equal. https://bugzilla.gnome.org/show_bug.cgi?id=753881
This commit is contained in:
parent
40d2693d07
commit
48fefd8c84
1 changed files with 4 additions and 4 deletions
|
@ -558,13 +558,13 @@ GST_START_TEST (test_playlist_with_doubles_duration)
|
|||
pl = client->current;
|
||||
/* Check first media segments */
|
||||
file = GST_M3U8_MEDIA_FILE (g_list_nth_data (pl->files, 0));
|
||||
assert_equals_uint64 (file->duration, 10.321 * GST_SECOND);
|
||||
assert_equals_float (file->duration / (double) GST_SECOND, 10.321);
|
||||
file = GST_M3U8_MEDIA_FILE (g_list_nth_data (pl->files, 1));
|
||||
assert_equals_uint64 (file->duration, 9.6789 * GST_SECOND);
|
||||
assert_equals_float (file->duration / (double) GST_SECOND, 9.6789);
|
||||
file = GST_M3U8_MEDIA_FILE (g_list_nth_data (pl->files, 2));
|
||||
assert_equals_uint64 (file->duration, 10.2344 * GST_SECOND);
|
||||
assert_equals_float (file->duration / (double) GST_SECOND, 10.2344);
|
||||
file = GST_M3U8_MEDIA_FILE (g_list_nth_data (pl->files, 3));
|
||||
assert_equals_uint64 (file->duration, 9.92 * GST_SECOND);
|
||||
assert_equals_float (file->duration / (double) GST_SECOND, 9.92);
|
||||
gst_m3u8_client_free (client);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue