Module: wine Branch: stable Commit: a2b7d799dfb7b8c4adff64a8d347729421846616 URL: https://gitlab.winehq.org/wine/wine/-/commit/a2b7d799dfb7b8c4adff64a8d347729...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Sep 12 11:53:50 2022 +0200
kernel32/tests: Fix affinity test when there are too many CPUs.
(cherry picked from commit 5314fac5b77ef7d6b157e975b90ec094d4353db8) Conflicts: dlls/kernel32/tests/thread.c Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/kernel32/tests/thread.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index e9fd90b1889..bbff60ab596 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -954,12 +954,15 @@ static VOID test_thread_processor(void) affinity_new.Mask, affinity.Mask);
/* show that the "all processors" flag is not supported for SetThreadGroupAffinity */ - affinity_new.Group = 0; - affinity_new.Mask = ~0u; - SetLastError(0xdeadbeef); - ok(!pSetThreadGroupAffinity(curthread, &affinity_new, NULL), "SetThreadGroupAffinity succeeded\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + if (sysInfo.dwNumberOfProcessors < 8 * sizeof(DWORD_PTR)) + { + affinity_new.Group = 0; + affinity_new.Mask = ~(DWORD_PTR)0; + SetLastError(0xdeadbeef); + ok(!pSetThreadGroupAffinity(curthread, &affinity_new, NULL), "SetThreadGroupAffinity succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + }
affinity_new.Group = 1; /* assumes that you have less than 64 logical processors */ affinity_new.Mask = 0x1;