From 2c0951774be922abc533709d25c50caf52db517c Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Mon, 17 Dec 2018 23:29:16 +0900 Subject: [PATCH] tests: datetime: Fix failure on Windows The documentation for WIN32 mktime indicates that for struct tm* before January 1, 1970, that -1 is returned, and since mktime is timezone dependent, the struct tm corresponding to 1:00, Jan. 1, 1970 might be failed. See also https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64 --- tests/check/gst/gstdatetime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/check/gst/gstdatetime.c b/tests/check/gst/gstdatetime.c index 89fc1e764c..801ff938a8 100644 --- a/tests/check/gst/gstdatetime.c +++ b/tests/check/gst/gstdatetime.c @@ -85,7 +85,7 @@ GST_START_TEST (test_GstDateTime_new_from_unix_epoch_local_time) memset (&tm, 0, sizeof (tm)); tm.tm_year = 70; - tm.tm_mday = 1; + tm.tm_mday = 2; tm.tm_mon = 0; tm.tm_hour = 1; tm.tm_min = 0; @@ -95,7 +95,7 @@ GST_START_TEST (test_GstDateTime_new_from_unix_epoch_local_time) 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_day (dt), 2); 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);