From: Havard Graff Date: Wed, 31 Oct 2018 09:29:22 +0000 (+0100) Subject: test/datetime: fix test for windows X-Git-Tag: 1.16.2~195 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=320ac0ce1a878e6055b900ffb2ffa92b355e85f5;p=platform%2Fupstream%2Fgstreamer.git test/datetime: fix test for windows In the previous configuration, mktime returned -1 on Windows 10 compiled with MSVC using meson. Fix this by moving the hour one forward. --- diff --git a/tests/check/gst/gstdatetime.c b/tests/check/gst/gstdatetime.c index 7bbc5bd..89fc1e7 100644 --- a/tests/check/gst/gstdatetime.c +++ b/tests/check/gst/gstdatetime.c @@ -87,15 +87,16 @@ GST_START_TEST (test_GstDateTime_new_from_unix_epoch_local_time) tm.tm_year = 70; tm.tm_mday = 1; tm.tm_mon = 0; - tm.tm_hour = 0; + tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; t = mktime (&tm); + fail_unless (t != -1); dt = gst_date_time_new_from_unix_epoch_local_time (t); assert_equals_int (gst_date_time_get_year (dt), 1970); assert_equals_int (gst_date_time_get_month (dt), 1); assert_equals_int (gst_date_time_get_day (dt), 1); - assert_equals_int (gst_date_time_get_hour (dt), 0); + assert_equals_int (gst_date_time_get_hour (dt), 1); assert_equals_int (gst_date_time_get_minute (dt), 0); assert_equals_int (gst_date_time_get_second (dt), 0); gst_date_time_unref (dt);