Commit d91e9514 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

kernel32/tests: Add tests for Get(Active|Maximum)ProcessorCount.

parent 114d5126
......@@ -90,6 +90,8 @@ static SIZE_T (WINAPI *pGetLargePageMinimum)(void);
static BOOL (WINAPI *pInitializeProcThreadAttributeList)(struct _PROC_THREAD_ATTRIBUTE_LIST*, DWORD, DWORD, SIZE_T*);
static BOOL (WINAPI *pUpdateProcThreadAttribute)(struct _PROC_THREAD_ATTRIBUTE_LIST*, DWORD, DWORD_PTR, void *,SIZE_T,void*,SIZE_T*);
static void (WINAPI *pDeleteProcThreadAttributeList)(struct _PROC_THREAD_ATTRIBUTE_LIST*);
static DWORD (WINAPI *pGetActiveProcessorCount)(WORD);
static DWORD (WINAPI *pGetMaximumProcessorCount)(WORD);
/* ############################### */
static char base[MAX_PATH];
......@@ -270,6 +272,8 @@ static BOOL init(void)
pInitializeProcThreadAttributeList = (void *)GetProcAddress(hkernel32, "InitializeProcThreadAttributeList");
pUpdateProcThreadAttribute = (void *)GetProcAddress(hkernel32, "UpdateProcThreadAttribute");
pDeleteProcThreadAttributeList = (void *)GetProcAddress(hkernel32, "DeleteProcThreadAttributeList");
pGetActiveProcessorCount = (void *)GetProcAddress(hkernel32, "GetActiveProcessorCount");
pGetMaximumProcessorCount = (void *)GetProcAddress(hkernel32, "GetMaximumProcessorCount");
return TRUE;
}
......@@ -2320,6 +2324,23 @@ static void test_SystemInfo(void)
}
}
static void test_ProcessorCount(void)
{
DWORD active, maximum;
if (!pGetActiveProcessorCount || !pGetMaximumProcessorCount)
{
win_skip("GetActiveProcessorCount or GetMaximumProcessorCount is not available\n");
return;
}
active = pGetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
maximum = pGetMaximumProcessorCount(ALL_PROCESSOR_GROUPS);
ok(active <= maximum,
"Number of active processors %i is greater than maximum number of processors %i\n",
active, maximum);
}
static void test_RegistryQuota(void)
{
BOOL ret;
......@@ -4257,6 +4278,7 @@ START_TEST(process)
test_IsWow64Process();
test_IsWow64Process2();
test_SystemInfo();
test_ProcessorCount();
test_RegistryQuota();
test_DuplicateHandle();
test_StartupNoConsole();
......
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