Skip to content

Commit

Permalink
msvcr110/tests: Add GetNumberOfVirtualProcessors tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Lehman <[email protected]>
Signed-off-by: Piotr Caban <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
dlehman-work authored and julliard committed Jul 18, 2018
1 parent b7f3e26 commit 8ae5352
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions dlls/msvcr110/tests/msvcr110.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

static char* (CDECL *p_setlocale)(int category, const char* locale);

static unsigned int (CDECL *p_CurrentScheduler_GetNumberOfVirtualProcessors)(void);
static unsigned int (CDECL *p__CurrentScheduler__GetNumberOfVirtualProcessors)(void);

static BOOL init(void)
{
HMODULE module;
Expand All @@ -45,9 +48,30 @@ static BOOL init(void)
}

p_setlocale = (void*)GetProcAddress(module, "setlocale");
p_CurrentScheduler_GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?GetNumberOfVirtualProcessors@CurrentScheduler@Concurrency@@SAIXZ");
p__CurrentScheduler__GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?_GetNumberOfVirtualProcessors@_CurrentScheduler@details@Concurrency@@SAIXZ");

return TRUE;
}

static void test_CurrentScheduler(void)
{
unsigned int ncpus;
unsigned int expect;
SYSTEM_INFO si;

expect = ~0;
ncpus = p_CurrentScheduler_GetNumberOfVirtualProcessors();
ok(ncpus == expect, "expected %x, got %x\n", expect, ncpus);

GetSystemInfo(&si);
expect = si.dwNumberOfProcessors;
ncpus = p__CurrentScheduler__GetNumberOfVirtualProcessors();
todo_wine ok(ncpus == expect, "expected %u, got %u\n", expect, ncpus);
ncpus = p_CurrentScheduler_GetNumberOfVirtualProcessors();
todo_wine ok(ncpus == expect, "expected %u, got %u\n", expect, ncpus);
}

static void test_setlocale(void)
{
int i;
Expand Down Expand Up @@ -76,5 +100,6 @@ static void test_setlocale(void)
START_TEST(msvcr110)
{
if (!init()) return;
test_CurrentScheduler(); /* MUST be first (at least among Concurrency tests) */
test_setlocale();
}

0 comments on commit 8ae5352

Please sign in to comment.