Commit e39c09f5 authored by André Zwing's avatar André Zwing Committed by Alexandre Julliard

kernel32/tests: Don't test function directly when reporting GetLastError().

parent e2b0cbb7
...@@ -4224,6 +4224,7 @@ static void test_PrefetchVirtualMemory(void) ...@@ -4224,6 +4224,7 @@ static void test_PrefetchVirtualMemory(void)
char stackmem[] = "Test stack mem"; char stackmem[] = "Test stack mem";
static char testmem[] = "Test memory range data"; static char testmem[] = "Test memory range data";
unsigned int page_size = si.dwPageSize; unsigned int page_size = si.dwPageSize;
BOOL ret;
if (!pPrefetchVirtualMemory) if (!pPrefetchVirtualMemory)
{ {
...@@ -4236,28 +4237,28 @@ static void test_PrefetchVirtualMemory(void) ...@@ -4236,28 +4237,28 @@ static void test_PrefetchVirtualMemory(void)
entries[0].VirtualAddress = ULongToPtr(PtrToUlong(testmem) & -(ULONG_PTR)page_size); entries[0].VirtualAddress = ULongToPtr(PtrToUlong(testmem) & -(ULONG_PTR)page_size);
entries[0].NumberOfBytes = page_size; entries[0].NumberOfBytes = page_size;
ok( pPrefetchVirtualMemory( GetCurrentProcess(), 1, entries, 0 ) || ret = pPrefetchVirtualMemory( GetCurrentProcess(), 1, entries, 0 );
broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */, ok( ret || broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */,
"PrefetchVirtualMemory unexpected status on 1 page-aligned entry: %ld\n", GetLastError() ); "PrefetchVirtualMemory unexpected status on 1 page-aligned entry: %ld\n", GetLastError() );
entries[0].VirtualAddress = testmem; entries[0].VirtualAddress = testmem;
entries[0].NumberOfBytes = sizeof(testmem); entries[0].NumberOfBytes = sizeof(testmem);
ok( pPrefetchVirtualMemory( GetCurrentProcess(), 1, entries, 0 ) || ret = pPrefetchVirtualMemory( GetCurrentProcess(), 1, entries, 0 );
broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */, ok( ret || broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */,
"PrefetchVirtualMemory unexpected status on 1 entry: %ld\n", GetLastError() ); "PrefetchVirtualMemory unexpected status on 1 entry: %ld\n", GetLastError() );
entries[0].VirtualAddress = NULL; entries[0].VirtualAddress = NULL;
entries[0].NumberOfBytes = page_size; entries[0].NumberOfBytes = page_size;
ok( pPrefetchVirtualMemory( GetCurrentProcess(), 1, entries, 0 ) || ret = pPrefetchVirtualMemory( GetCurrentProcess(), 1, entries, 0 );
broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */, ok( ret ||broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */,
"PrefetchVirtualMemory unexpected status on 1 unmapped entry: %ld\n", GetLastError() ); "PrefetchVirtualMemory unexpected status on 1 unmapped entry: %ld\n", GetLastError() );
entries[0].VirtualAddress = ULongToPtr(PtrToUlong(testmem) & -(ULONG_PTR)page_size); entries[0].VirtualAddress = ULongToPtr(PtrToUlong(testmem) & -(ULONG_PTR)page_size);
entries[0].NumberOfBytes = page_size; entries[0].NumberOfBytes = page_size;
entries[1].VirtualAddress = ULongToPtr(PtrToUlong(stackmem) & -(ULONG_PTR)page_size); entries[1].VirtualAddress = ULongToPtr(PtrToUlong(stackmem) & -(ULONG_PTR)page_size);
entries[1].NumberOfBytes = page_size; entries[1].NumberOfBytes = page_size;
ok( pPrefetchVirtualMemory( GetCurrentProcess(), 2, entries, 0 ) || ret = pPrefetchVirtualMemory( GetCurrentProcess(), 2, entries, 0 );
broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */, ok( ret ||broken( is_wow64 && GetLastError() == ERROR_INVALID_PARAMETER ) /* win10 1507 */,
"PrefetchVirtualMemory unexpected status on 2 page-aligned entries: %ld\n", GetLastError() ); "PrefetchVirtualMemory unexpected status on 2 page-aligned entries: %ld\n", GetLastError() );
} }
......
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