tests: videotimecode: fix floating point comparisons
authorTim-Philipp Müller <tim@centricular.com>
Sat, 24 Sep 2016 20:11:32 +0000 (21:11 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 25 Sep 2016 21:20:27 +0000 (22:20 +0100)
Comparing floats for equality is not necessarily going to
work reliably, so use fail_unless_equals_float() for this.
Test would fail on x86 (Intel Atom x5-Z8300).

tests/check/libs/videotimecode.c

index c403db8..23d6b50 100644 (file)
@@ -332,7 +332,7 @@ GST_START_TEST (videotimecode_dailyjam_todatetime)
   fail_unless (g_date_time_get_day_of_month (dt2) == 29);
   fail_unless (g_date_time_get_hour (dt2) == 11);
   fail_unless (g_date_time_get_minute (dt2) == 36);
-  fail_unless (g_date_time_get_seconds (dt2) == 53.04);
+  fail_unless_equals_float (g_date_time_get_seconds (dt2), 53.04);
 
   gst_video_time_code_free (tc1);
   g_date_time_unref (dt2);