[glib] tests/gdatetime: fix new_from_unix test



commit 51609ec943f9d51a8c8863badd79d2a9293ae4c7
Author: Dan Winship <danw gnome org>
Date:   Wed Apr 4 14:38:18 2012 -0400

    tests/gdatetime: fix new_from_unix test
    
    When creating a struct tm for "1990-01-01T00:00:00" to pass to
    mktime(), we have to set tm_isdst to -1; leaving it set to 0 will
    result in the wrong time being generated when run in a timezone where
    January 1 would normally be tm_isdst==1 (ie, in southern hemisphere
    DST-observing countries, like Australia).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=670254

 glib/tests/gdatetime.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 516c4fc..0dea323 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -114,6 +114,7 @@ test_GDateTime_new_from_unix (void)
   tm.tm_hour = 0;
   tm.tm_min = 0;
   tm.tm_sec = 0;
+  tm.tm_isdst = -1;
   t = mktime (&tm);
 
   dt = g_date_time_new_from_unix_local (t);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]