kernel32/tests: Avoid intermittent test failures.

This commit is contained in:
Dmitry Timoshkov 2015-08-23 14:12:52 +08:00 committed by Alexandre Julliard
parent d6e1e710ee
commit 0a2ef17620
1 changed files with 21 additions and 4 deletions

View File

@ -1716,7 +1716,7 @@ static void test_thread_info(void)
/* FIXME: Add remaining classes */
};
HANDLE thread;
ULONG i, status, ret_len, size;
ULONG i, status, ret_len;
if (!pOpenThread)
{
@ -1739,8 +1739,19 @@ static void test_thread_info(void)
for (i = 0; i < sizeof(info_size)/sizeof(info_size[0]); i++)
{
size = info_size[i];
if (!size) size = sizeof(buf);
memset(buf, 0, sizeof(buf));
#ifdef __i386__
if (i == ThreadDescriptorTableEntry)
{
CONTEXT ctx;
THREAD_DESCRIPTOR_INFORMATION *tdi = (void *)buf;
ctx.ContextFlags = CONTEXT_SEGMENTS;
GetThreadContext(GetCurrentThread(), &ctx);
tdi->Selector = ctx.SegDs;
}
#endif
ret_len = 0;
status = pNtQueryInformationThread(thread, i, buf, info_size[i], &ret_len);
if (status == STATUS_NOT_IMPLEMENTED) continue;
@ -1755,12 +1766,18 @@ static void test_thread_info(void)
ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len);
break;
#ifdef __i386__
case ThreadDescriptorTableEntry:
ok(status == STATUS_SUCCESS || broken(status == STATUS_ACCESS_DENIED) /* testbot VM is broken */,
"for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len);
break;
#endif
case ThreadTimes:
todo_wine
ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len);
break;
case ThreadDescriptorTableEntry:
case ThreadAffinityMask:
case ThreadQuerySetWin32StartAddress:
todo_wine