kernel32/tests: Fix processor tests on multicore platforms
André Hentschel
nerv at dawncrow.de
Thu Mar 24 12:59:23 CDT 2011
At the moment i have no clue how to fix the todo_wines
---
dlls/kernel32/tests/thread.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
index 25b55ac..2e29a4a 100644
--- a/dlls/kernel32/tests/thread.c
+++ b/dlls/kernel32/tests/thread.c
@@ -65,6 +65,7 @@ static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL);
static BOOL (WINAPI *pSetThreadErrorMode)(DWORD,PDWORD);
static DWORD (WINAPI *pGetThreadErrorMode)(void);
static DWORD (WINAPI *pRtlGetThreadErrorMode)(void);
+static const int is_win64 = (sizeof(void *) > sizeof(int));
static HANDLE create_target_process(const char *arg)
{
@@ -821,7 +822,7 @@ static VOID test_thread_processor(void)
retMask = SetThreadAffinityMask(curthread,~0);
ok(broken(retMask==0) || retMask==processMask,
"SetThreadAffinityMask(thread,-1) failed to request all processors.\n");
- if (retMask == processMask && sizeof(ULONG_PTR) > sizeof(ULONG))
+ if (retMask == processMask && is_win64)
{
/* only the low 32-bits matter */
retMask = SetThreadAffinityMask(curthread,~(ULONG_PTR)0);
@@ -829,7 +830,10 @@ static VOID test_thread_processor(void)
retMask = SetThreadAffinityMask(curthread,~(ULONG_PTR)0 >> 3);
ok(retMask == processMask, "SetThreadAffinityMask failed\n");
retMask = SetThreadAffinityMask(curthread,~(ULONG_PTR)1);
- ok(retMask == 0, "SetThreadAffinityMask succeeded\n");
+ if (sysInfo.dwNumberOfProcessors > 1)
+ todo_wine ok(retMask == processMask, "SetThreadAffinityMask failed\n");
+ else
+ ok(retMask == 0, "SetThreadAffinityMask succeeded\n");
}
/* NOTE: This only works on WinNT/2000/XP) */
if (pSetThreadIdealProcessor) {
@@ -865,7 +869,10 @@ static VOID test_thread_processor(void)
}
error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS);
- ok(error!=-1, "SetThreadIdealProcessor failed\n");
+ if (sysInfo.dwNumberOfProcessors > 1)
+ todo_wine ok(error > 0, "SetThreadIdealProcessor failed\n");
+ else
+ ok(error == 0, "SetThreadIdealProcessor failed\n");
}
}
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list