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:
Руслан Ижбулатов 2019-02-08 20:54:50 +00:00 committed by Philip Withnall
parent 00908bc446
commit 3ffa7ed0b6

View File

@ -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);