2 * Unit test suite for time functions
4 * Copyright 2004 Uwe Bonnes
5 * Copyright 2007 Dmitry Timoshkov
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/test.h"
25 static BOOL (WINAPI *pTzSpecificLocalTimeToSystemTime)(LPTIME_ZONE_INFORMATION, LPSYSTEMTIME, LPSYSTEMTIME);
26 static BOOL (WINAPI *pSystemTimeToTzSpecificLocalTime)(LPTIME_ZONE_INFORMATION, LPSYSTEMTIME, LPSYSTEMTIME);
29 #define SECSPERDAY 86400
30 /* 1601 to 1970 is 369 years plus 89 leap days */
31 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
32 #define TICKSPERSEC 10000000
33 #define TICKSPERMSEC 10000
34 #define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC)
37 #define NEWYEAR_1980_HI 0x01a8e79f
38 #define NEWYEAR_1980_LO 0xe1d58000
40 #define MAYDAY_2002_HI 0x01c1f107
41 #define MAYDAY_2002_LO 0xb82b6000
43 #define ATIME_HI 0x1c2349b
44 #define ATIME_LOW 0x580716b0
46 #define LOCAL_ATIME_HI 0x01c23471
47 #define LOCAL_ATIME_LOW 0x6f310eb0
49 #define DOS_DATE(y,m,d) ( (((y)-1980)<<9) | ((m)<<5) | (d) )
50 #define DOS_TIME(h,m,s) ( ((h)<<11) | ((m)<<5) | ((s)>>1) )
53 #define SETUP_1980(st) \
60 (st).wMilliseconds = 0;
62 #define SETUP_2002(st) \
69 (st).wMilliseconds = 0;
71 #define SETUP_ATIME(st) \
78 (st).wMilliseconds = 123;
80 #define SETUP_ZEROTIME(st) \
87 (st).wMilliseconds = 0;
89 #define SETUP_EARLY(st) \
96 (st).wMilliseconds = 999;
99 static void test_conversions(void)
104 memset(&ft,0,sizeof ft);
107 ok (!SystemTimeToFileTime(&st, &ft), "Conversion succeeded EARLY\n");
108 ok (GetLastError() == ERROR_INVALID_PARAMETER, "EARLY should be INVALID\n");
111 ok (SystemTimeToFileTime(&st, &ft), "Conversion failed ZERO_TIME\n");
112 ok( (!((ft.dwHighDateTime != 0) || (ft.dwLowDateTime != 0))),
113 "Wrong time for ATIME: %08x %08x (correct %08x %08x)\n",
114 ft.dwLowDateTime, ft.dwHighDateTime, 0, 0);
118 ok (SystemTimeToFileTime(&st,&ft), "Conversion Failed ATIME\n");
119 ok( (!((ft.dwHighDateTime != ATIME_HI) || (ft.dwLowDateTime!=ATIME_LOW))),
120 "Wrong time for ATIME: %08x %08x (correct %08x %08x)\n",
121 ft.dwLowDateTime, ft.dwHighDateTime, ATIME_LOW, ATIME_HI);
125 ok (SystemTimeToFileTime(&st, &ft), "Conversion failed 2002\n");
127 ok( (!((ft.dwHighDateTime != MAYDAY_2002_HI) ||
128 (ft.dwLowDateTime!=MAYDAY_2002_LO))),
129 "Wrong time for 2002 %08x %08x (correct %08x %08x)\n", ft.dwLowDateTime,
130 ft.dwHighDateTime, MAYDAY_2002_LO, MAYDAY_2002_HI);
134 ok((SystemTimeToFileTime(&st, &ft)), "Conversion failed 1980\n");
136 ok( (!((ft.dwHighDateTime!=NEWYEAR_1980_HI) ||
137 (ft.dwLowDateTime!=NEWYEAR_1980_LO))) ,
138 "Wrong time for 1980 %08x %08x (correct %08x %08x)\n", ft.dwLowDateTime,
139 ft.dwHighDateTime, NEWYEAR_1980_LO,NEWYEAR_1980_HI );
141 ok(DosDateTimeToFileTime(DOS_DATE(1980,1,1),DOS_TIME(0,0,0),&ft),
142 "DosDateTimeToFileTime() failed\n");
144 ok( (!((ft.dwHighDateTime!=NEWYEAR_1980_HI) ||
145 (ft.dwLowDateTime!=NEWYEAR_1980_LO))),
146 "Wrong time DosDateTimeToFileTime %08x %08x (correct %08x %08x)\n",
147 ft.dwHighDateTime, ft.dwLowDateTime, NEWYEAR_1980_HI, NEWYEAR_1980_LO);
151 static void test_invalid_arg(void)
157 /* Invalid argument checks */
159 memset(&ft,0,sizeof ft);
160 ok( DosDateTimeToFileTime(DOS_DATE(1980,1,1),DOS_TIME(0,0,0),&ft), /* this is 1 Jan 1980 00:00:00 */
161 "DosDateTimeToFileTime() failed\n");
163 ok( (ft.dwHighDateTime==NEWYEAR_1980_HI) && (ft.dwLowDateTime==NEWYEAR_1980_LO),
164 "filetime for 1/1/80 00:00:00 was %08x %08x\n", ft.dwHighDateTime, ft.dwLowDateTime);
166 /* now check SystemTimeToFileTime */
167 memset(&ft,0,sizeof ft);
170 /* try with a bad month */
174 ok( !SystemTimeToFileTime(&st, &ft), "bad month\n");
176 /* with a bad hour */
180 ok( !SystemTimeToFileTime(&st, &ft), "bad hour\n");
182 /* with a bad minute */
186 ok( !SystemTimeToFileTime(&st, &ft), "bad minute\n");
189 static LONGLONG system_time_to_minutes(const SYSTEMTIME *st)
195 SetLastError(0xdeadbeef);
196 ret = SystemTimeToFileTime(st, &ft);
197 ok(ret, "SystemTimeToFileTime error %u\n", GetLastError());
199 minutes = ((LONGLONG)ft.dwHighDateTime << 32) + ft.dwLowDateTime;
200 minutes /= (LONGLONG)600000000; /* convert to minutes */
204 static LONG get_tz_bias(const TIME_ZONE_INFORMATION *tzinfo, DWORD tz_id)
208 case TIME_ZONE_ID_DAYLIGHT:
209 return tzinfo->DaylightBias;
211 case TIME_ZONE_ID_STANDARD:
212 return tzinfo->StandardBias;
215 trace("unknown time zone id %d\n", tz_id);
217 case TIME_ZONE_ID_UNKNOWN:
222 static void test_GetTimeZoneInformation(void)
224 TIME_ZONE_INFORMATION tzinfo, tzinfo1;
227 SYSTEMTIME st, current, utc, local;
229 LONGLONG l_time, s_time;
233 s_time = system_time_to_minutes(&st);
235 SetLastError(0xdeadbeef);
236 res = SystemTimeToFileTime(&st, &s_ft);
237 ok(res, "SystemTimeToFileTime error %u\n", GetLastError());
238 SetLastError(0xdeadbeef);
239 res = FileTimeToLocalFileTime(&s_ft, &l_ft);
240 ok(res, "FileTimeToLocalFileTime error %u\n", GetLastError());
241 SetLastError(0xdeadbeef);
242 res = FileTimeToSystemTime(&l_ft, &local);
243 ok(res, "FileTimeToSystemTime error %u\n", GetLastError());
244 l_time = system_time_to_minutes(&local);
246 tz_id = GetTimeZoneInformation(&tzinfo);
247 ok(tz_id != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
249 trace("bias %d\n", tzinfo.Bias);
250 trace("standard (d/m/y): %u/%02u/%04u day of week %u %u:%02u:%02u.%03u bias %d\n",
251 tzinfo.StandardDate.wDay, tzinfo.StandardDate.wMonth,
252 tzinfo.StandardDate.wYear, tzinfo.StandardDate.wDayOfWeek,
253 tzinfo.StandardDate.wHour, tzinfo.StandardDate.wMinute,
254 tzinfo.StandardDate.wSecond, tzinfo.StandardDate.wMilliseconds,
255 tzinfo.StandardBias);
256 trace("daylight (d/m/y): %u/%02u/%04u day of week %u %u:%02u:%02u.%03u bias %d\n",
257 tzinfo.DaylightDate.wDay, tzinfo.DaylightDate.wMonth,
258 tzinfo.DaylightDate.wYear, tzinfo.DaylightDate.wDayOfWeek,
259 tzinfo.DaylightDate.wHour, tzinfo.DaylightDate.wMinute,
260 tzinfo.DaylightDate.wSecond, tzinfo.DaylightDate.wMilliseconds,
261 tzinfo.DaylightBias);
263 diff = (LONG)(s_time - l_time);
264 ok(diff == tzinfo.Bias + get_tz_bias(&tzinfo, tz_id),
265 "system/local diff %d != tz bias %d\n",
266 diff, tzinfo.Bias + get_tz_bias(&tzinfo, tz_id));
268 ok(SetEnvironmentVariableA("TZ","GMT0") != 0,
269 "SetEnvironmentVariableA failed\n");
270 res = GetTimeZoneInformation(&tzinfo1);
271 ok(res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
273 ok(((tzinfo.Bias == tzinfo1.Bias) &&
274 (tzinfo.StandardBias == tzinfo1.StandardBias) &&
275 (tzinfo.DaylightBias == tzinfo1.DaylightBias)),
276 "Bias influenced by TZ variable\n");
277 ok(SetEnvironmentVariableA("TZ",NULL) != 0,
278 "SetEnvironmentVariableA failed\n");
280 if (!pSystemTimeToTzSpecificLocalTime)
282 skip("SystemTimeToTzSpecificLocalTime not present\n");
286 diff = get_tz_bias(&tzinfo, tz_id);
289 SetLastError(0xdeadbeef);
290 res = pSystemTimeToTzSpecificLocalTime(&tzinfo, &utc, ¤t);
291 ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError());
292 s_time = system_time_to_minutes(¤t);
294 tzinfo.StandardBias -= 123;
295 tzinfo.DaylightBias += 456;
297 res = pSystemTimeToTzSpecificLocalTime(&tzinfo, &utc, &local);
298 ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError());
299 l_time = system_time_to_minutes(&local);
300 ok(l_time - s_time == diff - get_tz_bias(&tzinfo, tz_id), "got %d, expected %d\n",
301 (LONG)(l_time - s_time), diff - get_tz_bias(&tzinfo, tz_id));
303 /* pretend that there is no transition dates */
304 tzinfo.DaylightDate.wDay = 0;
305 tzinfo.DaylightDate.wMonth = 0;
306 tzinfo.DaylightDate.wYear = 0;
307 tzinfo.StandardDate.wDay = 0;
308 tzinfo.StandardDate.wMonth = 0;
309 tzinfo.StandardDate.wYear = 0;
311 res = pSystemTimeToTzSpecificLocalTime(&tzinfo, &utc, &local);
312 ok(res, "SystemTimeToTzSpecificLocalTime error %u\n", GetLastError());
313 l_time = system_time_to_minutes(&local);
314 ok(l_time - s_time == diff, "got %d, expected %d\n",
315 (LONG)(l_time - s_time), diff);
318 static void test_FileTimeToSystemTime(void)
322 ULONGLONG time = (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970;
325 ft.dwHighDateTime = 0;
326 ft.dwLowDateTime = 0;
327 ret = FileTimeToSystemTime(&ft, &st);
329 "FileTimeToSystemTime() failed with Error %d\n",GetLastError());
330 ok(((st.wYear == 1601) && (st.wMonth == 1) && (st.wDay == 1) &&
331 (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 0) &&
332 (st.wMilliseconds == 0)),
333 "Got Year %4d Month %2d Day %2d\n", st.wYear, st.wMonth, st.wDay);
335 ft.dwHighDateTime = (UINT)(time >> 32);
336 ft.dwLowDateTime = (UINT)time;
337 ret = FileTimeToSystemTime(&ft, &st);
339 "FileTimeToSystemTime() failed with Error %d\n",GetLastError());
340 ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) &&
341 (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) &&
342 (st.wMilliseconds == 0)),
343 "Got Year %4d Month %2d Day %2d Hour %2d Min %2d Sec %2d mSec %3d\n",
344 st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond,
348 static void test_FileTimeToLocalFileTime(void)
352 TIME_ZONE_INFORMATION tzinfo;
353 DWORD res = GetTimeZoneInformation(&tzinfo);
354 ULONGLONG time = (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970 +
355 (LONGLONG)(tzinfo.Bias +
356 ( res == TIME_ZONE_ID_STANDARD ? tzinfo.StandardBias :
357 ( res == TIME_ZONE_ID_DAYLIGHT ? tzinfo.DaylightBias : 0 ))) *
358 SECSPERMIN *TICKSPERSEC;
361 ok( res != TIME_ZONE_ID_INVALID , "GetTimeZoneInformation failed\n");
362 ft.dwHighDateTime = (UINT)(time >> 32);
363 ft.dwLowDateTime = (UINT)time;
364 ret = FileTimeToLocalFileTime(&ft, &lft);
366 "FileTimeToLocalFileTime() failed with Error %d\n",GetLastError());
367 FileTimeToSystemTime(&lft, &st);
368 ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) &&
369 (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) &&
370 (st.wMilliseconds == 0)),
371 "Got Year %4d Month %2d Day %2d Hour %2d Min %2d Sec %2d mSec %3d\n",
372 st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond,
375 ok(SetEnvironmentVariableA("TZ","GMT") != 0,
376 "SetEnvironmentVariableA failed\n");
377 ok(res != TIME_ZONE_ID_INVALID, "GetTimeZoneInformation failed\n");
378 ret = FileTimeToLocalFileTime(&ft, &lft);
380 "FileTimeToLocalFileTime() failed with Error %d\n",GetLastError());
381 FileTimeToSystemTime(&lft, &st);
382 ok(((st.wYear == 1970) && (st.wMonth == 1) && (st.wDay == 1) &&
383 (st.wHour == 0) && (st.wMinute == 0) && (st.wSecond == 1) &&
384 (st.wMilliseconds == 0)),
385 "Got Year %4d Month %2d Day %2d Hour %2d Min %2d Sec %2d mSec %3d\n",
386 st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond,
388 ok(SetEnvironmentVariableA("TZ",NULL) != 0,
389 "SetEnvironmentVariableA failed\n");
393 int nr; /* test case number for easier lookup */
394 TIME_ZONE_INFORMATION *ptz; /* ptr to timezone */
395 SYSTEMTIME slt; /* system/local time to convert */
396 WORD ehour; /* expected hour */
399 static void test_TzSpecificLocalTimeToSystemTime(void)
401 TIME_ZONE_INFORMATION tzE, tzW, tzS;
405 if (!pTzSpecificLocalTimeToSystemTime || !pSystemTimeToTzSpecificLocalTime)
407 skip("TzSpecificLocalTimeToSystemTime or SystemTimeToTzSpecificLocalTime not present\n");
411 ZeroMemory( &tzE, sizeof(tzE));
412 ZeroMemory( &tzW, sizeof(tzW));
413 ZeroMemory( &tzS, sizeof(tzS));
414 /* timezone Eastern hemisphere */
417 tzE.DaylightBias=-60;
418 tzE.StandardDate.wMonth=10;
419 tzE.StandardDate.wDayOfWeek=0; /*sunday */
420 tzE.StandardDate.wDay=5; /* last (sunday) of the month */
421 tzE.StandardDate.wHour=3;
422 tzE.DaylightDate.wMonth=3;
423 tzE.DaylightDate.wDay=5;
424 tzE.DaylightDate.wHour=2;
425 /* timezone Western hemisphere */
428 tzW.DaylightBias=-60;
429 tzW.StandardDate.wMonth=10;
430 tzW.StandardDate.wDayOfWeek=0; /*sunday */
431 tzW.StandardDate.wDay=4; /* 4th (sunday) of the month */
432 tzW.StandardDate.wHour=2;
433 tzW.DaylightDate.wMonth=4;
434 tzW.DaylightDate.wDay=1;
435 tzW.DaylightDate.wHour=2;
436 /* timezone Eastern hemisphere */
439 tzS.DaylightBias=-60;
440 tzS.StandardDate.wMonth=4;
441 tzS.StandardDate.wDayOfWeek=0; /*sunday */
442 tzS.StandardDate.wDay=1; /* 1st (sunday) of the month */
443 tzS.StandardDate.wHour=2;
444 tzS.DaylightDate.wMonth=10;
445 tzS.DaylightDate.wDay=4;
446 tzS.DaylightDate.wHour=2;
448 /* TzSpecificLocalTimeToSystemTime */
449 { TZLT2ST_case cases[] = {
450 /* standard->daylight transition */
451 { 1, &tzE, {2004,3,-1,28,1,0,0,0}, 15 },
452 { 2, &tzE, {2004,3,-1,28,1,59,59,999}, 15},
453 { 3, &tzE, {2004,3,-1,28,2,0,0,0}, 15},
454 /* daylight->standard transition */
455 { 4, &tzE, {2004,10,-1,31,2,0,0,0} , 15 },
456 { 5, &tzE, {2004,10,-1,31,2,59,59,999}, 15 },
457 { 6, &tzE, {2004,10,-1,31,3,0,0,0}, 17 },
458 /* West and with fixed weekday of the month */
459 { 7, &tzW, {2004,4,-1,4,1,0,0,0}, 5},
460 { 8, &tzW, {2004,4,-1,4,1,59,59,999}, 5},
461 { 9, &tzW, {2004,4,-1,4,2,0,0,0}, 5},
462 { 10, &tzW, {2004,10,-1,24,1,0,0,0}, 4},
463 { 11, &tzW, {2004,10,-1,24,1,59,59,999}, 4},
464 { 12, &tzW, {2004,10,-1,24,2,0,0,0 }, 6},
466 { 13, &tzS, {2004,4,-1,4,1,0,0,0}, 4},
467 { 14, &tzS, {2004,4,-1,4,1,59,59,999}, 4},
468 { 15, &tzS, {2004,4,-1,4,2,0,0,0}, 6},
469 { 16, &tzS, {2004,10,-1,24,1,0,0,0}, 5},
470 { 17, &tzS, {2004,10,-1,24,1,59,59,999}, 5},
471 { 18, &tzS, {2004,10,-1,24,2,0,0,0}, 5},
474 /* days of transitions to put into the cases array */
477 {28,31,4,24,4,24} /* 1999 */
478 , {26,29,2,22,2,22} /* 2000 */
479 , {25,28,1,28,1,28} /* 2001 */
480 , {31,27,7,27,7,27} /* 2002 */
481 , {30,26,6,26,6,26} /* 2003 */
482 , {28,31,4,24,4,24} /* 2004 */
483 , {27,30,3,23,3,23} /* 2005 */
484 , {26,29,2,22,2,22} /* 2006 */
485 , {25,28,1,28,1,28} /* 2007 */
486 , {30,26,6,26,6,26} /* 2008 */
487 , {29,25,5,25,5,25} /* 2009 */
488 , {28,31,4,24,4,24} /* 2010 */
489 , {27,30,3,23,3,23} /* 2011 */
490 , {25,28,1,28,1,28} /* 2012 */
491 , {31,27,7,27,7,27} /* 2013 */
492 , {30,26,6,26,6,26} /* 2014 */
493 , {29,25,5,25,5,25} /* 2015 */
494 , {27,30,3,23,3,23} /* 2016 */
495 , {26,29,2,22,2,22} /* 2017 */
496 , {25,28,1,28,1,28} /* 2018 */
497 , {31,27,7,27,7,27} /* 2019 */
500 for( j=0 , year = 1999; yeardays[j][0] ; j++, year++) {
501 for (i=0; cases[i].nr; i++) {
502 if(i) cases[i].nr += 18;
503 cases[i].slt.wYear = year;
504 cases[i].slt.wDay = yeardays[j][i/3];
505 pTzSpecificLocalTimeToSystemTime( cases[i].ptz, &(cases[i].slt), &result);
506 ok( result.wHour == cases[i].ehour,
507 "Test TzSpecificLocalTimeToSystemTime #%d. Got %4d-%02d-%02d %02d:%02d. Expect hour = %02d\n",
508 cases[i].nr, result.wYear, result.wMonth, result.wDay,
509 result.wHour, result.wMinute, cases[i].ehour);
513 /* SystemTimeToTzSpecificLocalTime */
514 { TZLT2ST_case cases[] = {
515 /* standard->daylight transition */
516 { 1, &tzE, {2004,3,-1,27,15,0,0,0}, 1 },
517 { 2, &tzE, {2004,3,-1,27,15,59,59,999}, 1},
518 { 3, &tzE, {2004,3,-1,27,16,0,0,0}, 3},
519 /* daylight->standard transition */
520 { 4, &tzE, {2004,10,-1,30,15,0,0,0}, 2 },
521 { 5, &tzE, {2004,10,-1,30,15,59,59,999}, 2 },
522 { 6, &tzE, {2004,10,-1,30,16,0,0,0}, 2 },
523 /* West and with fixed weekday of the month */
524 { 7, &tzW, {2004,4,-1,4,5,0,0,0}, 1},
525 { 8, &tzW, {2004,4,-1,4,5,59,59,999}, 1},
526 { 9, &tzW, {2004,4,-1,4,6,0,0,0}, 3},
527 { 10, &tzW, {2004,10,-1,24,4,0,0,0}, 1},
528 { 11, &tzW, {2004,10,-1,24,4,59,59,999}, 1},
529 { 12, &tzW, {2004,10,-1,24,5,0,0,0 }, 1},
531 { 13, &tzS, {2004,4,-1,4,4,0,0,0}, 1},
532 { 14, &tzS, {2004,4,-1,4,4,59,59,999}, 1},
533 { 15, &tzS, {2004,4,-1,4,5,0,0,0}, 1},
534 { 16, &tzS, {2004,10,-1,24,5,0,0,0}, 1},
535 { 17, &tzS, {2004,10,-1,24,5,59,59,999}, 1},
536 { 18, &tzS, {2004,10,-1,24,6,0,0,0}, 3},
540 /* days of transitions to put into the cases array */
543 {27,30,4,24,4,24} /* 1999 */
544 , {25,28,2,22,2,22} /* 2000 */
545 , {24,27,1,28,1,28} /* 2001 */
546 , {30,26,7,27,7,27} /* 2002 */
547 , {29,25,6,26,6,26} /* 2003 */
548 , {27,30,4,24,4,24} /* 2004 */
549 , {26,29,3,23,3,23} /* 2005 */
550 , {25,28,2,22,2,22} /* 2006 */
551 , {24,27,1,28,1,28} /* 2007 */
552 , {29,25,6,26,6,26} /* 2008 */
553 , {28,24,5,25,5,25} /* 2009 */
554 , {27,30,4,24,4,24} /* 2010 */
555 , {26,29,3,23,3,23} /* 2011 */
556 , {24,27,1,28,1,28} /* 2012 */
557 , {30,26,7,27,7,27} /* 2013 */
558 , {29,25,6,26,6,26} /* 2014 */
559 , {28,24,5,25,5,25} /* 2015 */
560 , {26,29,3,23,3,23} /* 2016 */
561 , {25,28,2,22,2,22} /* 2017 */
562 , {24,27,1,28,1,28} /* 2018 */
563 , {30,26,7,27,7,27} /* 2019 */
565 for( j=0 , year = 1999; yeardays[j][0] ; j++, year++) {
566 for (i=0; cases[i].nr; i++) {
567 if(i) cases[i].nr += 18;
568 cases[i].slt.wYear = year;
569 cases[i].slt.wDay = yeardays[j][i/3];
570 pSystemTimeToTzSpecificLocalTime( cases[i].ptz, &(cases[i].slt), &result);
571 ok( result.wHour == cases[i].ehour,
572 "Test SystemTimeToTzSpecificLocalTime #%d. Got %4d-%02d-%02d %02d:%02d. Expect hour = %02d\n",
573 cases[i].nr, result.wYear, result.wMonth, result.wDay,
574 result.wHour, result.wMinute, cases[i].ehour);
583 HMODULE hKernel = GetModuleHandle("kernel32");
584 pTzSpecificLocalTimeToSystemTime = (void *)GetProcAddress(hKernel, "TzSpecificLocalTimeToSystemTime");
585 pSystemTimeToTzSpecificLocalTime = (void *)GetProcAddress( hKernel, "SystemTimeToTzSpecificLocalTime");
589 test_GetTimeZoneInformation();
590 test_FileTimeToSystemTime();
591 test_FileTimeToLocalFileTime();
592 test_TzSpecificLocalTimeToSystemTime();