Commit f01b9ab4 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

psapi/tests: Call GetPerformanceInfo() after NtQuerySystemInformation().

For some reason, this gives consistently much more accurate results. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 42016f6f
......@@ -238,11 +238,6 @@ static void test_GetPerformanceInfo(void)
ok(!ret, "GetPerformanceInfo unexpectedly succeeded\n");
ok(GetLastError() == ERROR_BAD_LENGTH, "expected error=ERROR_BAD_LENGTH but got %d\n", GetLastError());
SetLastError(0xdeadbeef);
ret = GetPerformanceInfo(&info, sizeof(info));
ok(ret, "GetPerformanceInfo failed with %d\n", GetLastError());
ok(info.cb == sizeof(PERFORMANCE_INFORMATION), "got %d\n", info.cb);
if (!pNtQuerySystemInformation)
win_skip("NtQuerySystemInformation not found, skipping tests\n");
else
......@@ -259,6 +254,10 @@ static void test_GetPerformanceInfo(void)
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
ok(size >= sizeof(SYSTEM_PERFORMANCE_INFORMATION), "incorrect length %d\n", size);
SetLastError(0xdeadbeef);
ret = GetPerformanceInfo(&info, sizeof(info));
ok(ret, "GetPerformanceInfo failed with %d\n", GetLastError());
ok(info.cb == sizeof(PERFORMANCE_INFORMATION), "got %d\n", info.cb);
ok(check_with_margin(info.CommitTotal, sys_performance_info->TotalCommittedPages, 288),
"expected approximately %ld but got %d\n", info.CommitTotal, sys_performance_info->TotalCommittedPages);
......
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