mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
GDate test: Disable Julian epoch test on Windows
Windows uses FILETIME, which starts counting from 1st Jan of year 1601 and, unlike time_t, can't be negative, so Windows simply has no way to do timestamp-math for dates before then. SYSTEMTIME (an equivalent of struct tm) can, obviously, represent almost arbitrary date starting from 1st Jan of year 0 (it's unsigned...), but GetDateFormatW() converts it to FILETIME at some point in its implementation, and fails. Unless the whole strftime() implementation of GDate is replaced by something that doesn't rely on WinAPI, this part of the test will never pass.
This commit is contained in:
parent
00908bc446
commit
3ffa7ed0b6
@ -133,10 +133,13 @@ int main(int argc, char** argv)
|
||||
g_date_set_julian(d, 1);
|
||||
TEST("GDate's \"Julian\" epoch's first day is valid", g_date_valid(d));
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
g_date_strftime(buf,100,"Our \"Julian\" epoch begins on a %A, in the month of %B, %x\n",
|
||||
d);
|
||||
g_print("%s", buf);
|
||||
|
||||
#else
|
||||
g_print ("But Windows FILETIME does not support dates before Jan 1 1601, so we can't strftime() the beginning of the \"Julian\" epoch.\n");
|
||||
#endif
|
||||
g_date_set_dmy(d, 10, 1, 2000);
|
||||
|
||||
g_date_strftime(buf,100,"%x", d);
|
||||
|
Loading…
Reference in New Issue
Block a user