Commit 081eae7a authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

ntdll/tests: Add tests for time zone names.

Test shows internal NT API returns an indirect string, e.g. @tzres.dll,-32, not a localized one in Vista or later. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d54bf06f
......@@ -27,6 +27,8 @@
static VOID (WINAPI *pRtlTimeToTimeFields)( const LARGE_INTEGER *liTime, PTIME_FIELDS TimeFields) ;
static VOID (WINAPI *pRtlTimeFieldsToTime)( PTIME_FIELDS TimeFields, PLARGE_INTEGER Time) ;
static NTSTATUS (WINAPI *pNtQueryPerformanceCounter)( LARGE_INTEGER *counter, LARGE_INTEGER *frequency );
static NTSTATUS (WINAPI *pRtlQueryTimeZoneInformation)( RTL_TIME_ZONE_INFORMATION *);
static NTSTATUS (WINAPI *pRtlQueryDynamicTimeZoneInformation)( RTL_DYNAMIC_TIME_ZONE_INFORMATION *);
static const int MonthLengths[2][12] =
{
......@@ -115,15 +117,57 @@ static void test_NtQueryPerformanceCounter(void)
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
}
static void test_RtlQueryTimeZoneInformation(void)
{
RTL_DYNAMIC_TIME_ZONE_INFORMATION tzinfo;
NTSTATUS status;
/* test RtlQueryTimeZoneInformation returns an indirect string,
e.g. @tzres.dll,-32 (Vista or later) */
if (!pRtlQueryTimeZoneInformation || !pRtlQueryDynamicTimeZoneInformation)
{
win_skip("Time zone name tests requires Vista or later\n");
return;
}
memset(&tzinfo, 0, sizeof(tzinfo));
status = pRtlQueryDynamicTimeZoneInformation(&tzinfo);
ok(status == STATUS_SUCCESS,
"RtlQueryDynamicTimeZoneInformation failed, got %08x\n", status);
todo_wine ok(tzinfo.StandardName[0] == '@',
"standard time zone name isn't an indirect string, got %s\n",
wine_dbgstr_w(tzinfo.StandardName));
todo_wine ok(tzinfo.DaylightName[0] == '@',
"daylight time zone name isn't an indirect string, got %s\n",
wine_dbgstr_w(tzinfo.DaylightName));
memset(&tzinfo, 0, sizeof(tzinfo));
status = pRtlQueryTimeZoneInformation((RTL_TIME_ZONE_INFORMATION *)&tzinfo);
ok(status == STATUS_SUCCESS,
"RtlQueryTimeZoneInformation failed, got %08x\n", status);
todo_wine ok(tzinfo.StandardName[0] == '@',
"standard time zone name isn't an indirect string, got %s\n",
wine_dbgstr_w(tzinfo.StandardName));
todo_wine ok(tzinfo.DaylightName[0] == '@',
"daylight time zone name isn't an indirect string, got %s\n",
wine_dbgstr_w(tzinfo.DaylightName));
}
START_TEST(time)
{
HMODULE mod = GetModuleHandleA("ntdll.dll");
pRtlTimeToTimeFields = (void *)GetProcAddress(mod,"RtlTimeToTimeFields");
pRtlTimeFieldsToTime = (void *)GetProcAddress(mod,"RtlTimeFieldsToTime");
pNtQueryPerformanceCounter = (void *)GetProcAddress(mod, "NtQueryPerformanceCounter");
pRtlQueryTimeZoneInformation =
(void *)GetProcAddress(mod, "RtlQueryTimeZoneInformation");
pRtlQueryDynamicTimeZoneInformation =
(void *)GetProcAddress(mod, "RtlQueryDynamicTimeZoneInformation");
if (pRtlTimeToTimeFields && pRtlTimeFieldsToTime)
test_pRtlTimeToTimeFields();
else
win_skip("Required time conversion functions are not available\n");
test_NtQueryPerformanceCounter();
test_RtlQueryTimeZoneInformation();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment