mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-05 08:56:16 +01:00
GDateTime test: 1970 doesn't exist on Windows
It is not safe to call the system library mktime() function on Windows with a date in the 70s. Use 1990 instead.
This commit is contained in:
parent
d62d0336b8
commit
44e85f7364
@ -108,7 +108,7 @@ test_GDateTime_new_from_unix (void)
|
||||
g_date_time_unref (dt);
|
||||
|
||||
memset (&tm, 0, sizeof (tm));
|
||||
tm.tm_year = 70;
|
||||
tm.tm_year = 90;
|
||||
tm.tm_mday = 1;
|
||||
tm.tm_mon = 0;
|
||||
tm.tm_hour = 0;
|
||||
@ -117,7 +117,7 @@ test_GDateTime_new_from_unix (void)
|
||||
t = mktime (&tm);
|
||||
|
||||
dt = g_date_time_new_from_unix_local (t);
|
||||
g_assert_cmpint (g_date_time_get_year (dt), ==, 1970);
|
||||
g_assert_cmpint (g_date_time_get_year (dt), ==, 1990);
|
||||
g_assert_cmpint (g_date_time_get_month (dt), ==, 1);
|
||||
g_assert_cmpint (g_date_time_get_day_of_month (dt), ==, 1);
|
||||
g_assert_cmpint (g_date_time_get_hour (dt), ==, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user