test_FileTimeToLocalFileTime fix
Rein Klazes
rklazes at xs4all.nl
Sun Oct 24 10:51:58 CDT 2004
Hi,
Changelog:
dlls/kernel/tests : time.c
Correctly use the return value of GetTimeZoneInformation.
Rein.
--
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/dlls/kernel/tests/time.c 2004-10-23 19:19:09.000000000 +0200
+++ mywine/dlls/kernel/tests/time.c 2004-10-23 21:24:28.000000000 +0200
@@ -34,11 +34,11 @@
{
TIME_ZONE_INFORMATION tzinfo, tzinfo1;
DWORD res = GetTimeZoneInformation(&tzinfo);
- ok(res != 0, "GetTimeZoneInformation failed\n");
+ ok(res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
ok(SetEnvironmentVariableA("TZ","GMT0") != 0,
"SetEnvironmentVariableA failed\n");
res = GetTimeZoneInformation(&tzinfo1);
- ok(res != 0, "GetTimeZoneInformation failed\n");
+ ok(res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
ok(((tzinfo.Bias == tzinfo1.Bias) &&
(tzinfo.StandardBias == tzinfo1.StandardBias) &&
@@ -82,10 +82,12 @@
SYSTEMTIME st;
TIME_ZONE_INFORMATION tzinfo;
DWORD res = GetTimeZoneInformation(&tzinfo);
- ULONGLONG time = (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970
- + (ULONGLONG)tzinfo.Bias*SECSPERMIN *TICKSPERSEC;
-
- ok( res != 0, "GetTimeZoneInformation failed\n");
+ ULONGLONG time = (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970 +
+ (LONGLONG)(tzinfo.Bias +
+ ( res == TIME_ZONE_ID_STANDARD ? tzinfo.StandardBias :
+ ( res == TIME_ZONE_ID_DAYLIGHT ? tzinfo.DaylightBias : 0 ))) *
+ SECSPERMIN *TICKSPERSEC;
+ ok( res != TIME_ZONE_ID_INVALID , "GetTimeZoneInformation failed\n");
ft.dwHighDateTime = (UINT)(time >> 32);
ft.dwLowDateTime = (UINT)time;
ok(FileTimeToLocalFileTime(&ft, &lft) !=0 ,
More information about the wine-patches
mailing list