[glib] GDateTime test: 1970 doesn't exist on Windows
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GDateTime test: 1970 doesn't exist on Windows
- Date: Tue, 26 Jul 2011 11:39:02 +0000 (UTC)
commit 44e85f73643ca24656aa89906d33a1385dcc87a5
Author: Ryan Lortie <desrt desrt ca>
Date: Tue Jul 26 13:38:04 2011 +0200
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.
glib/tests/gdatetime.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 611095c..0a9099e 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]