The todo_wine_if made the tests not really test anything, and one test was succeeding when it shouldn't. Now we can actually remove the todo when 1 zero_bits handling is implemented.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/tests/virtual.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 6fe4828095e..c892e4aa4e0 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -113,12 +113,14 @@ static void test_AllocateVirtualMemory(void) addr2 = NULL; zero_bits = 1; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || broken(status == STATUS_INVALID_PARAMETER_3) /* winxp */, "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) { + todo_wine_if(is_win64) ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, "NtAllocateVirtualMemory returned address: %p\n", addr2);
@@ -132,13 +134,14 @@ static void test_AllocateVirtualMemory(void) size = 0x1000; addr2 = NULL; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY || broken(zero_bits == 20 && status == STATUS_CONFLICTING_ADDRESSES) /* w1064v1809 */, "NtAllocateVirtualMemory with %d zero_bits returned %08x\n", zero_bits, status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)addr2 >> (32 - zero_bits)) + todo_wine ok(((UINT_PTR)addr2 >> (32 - zero_bits)) == 0, "NtAllocateVirtualMemory with %d zero_bits returned address %p\n", zero_bits, addr2);
@@ -176,7 +179,8 @@ static void test_AllocateVirtualMemory(void) addr2 = NULL; zero_bits = 0x1fffffff; status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr2, zero_bits, &size, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE);
if (!is_win64 && !is_wow64) { @@ -188,7 +192,7 @@ static void test_AllocateVirtualMemory(void) "NtAllocateVirtualMemory returned %08x\n", status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)addr2 & ~zero_bits) + todo_wine ok(((UINT_PTR)addr2 & ~zero_bits) == 0, "NtAllocateVirtualMemory returned address %p\n", addr2);
@@ -257,12 +261,12 @@ static void test_MapViewOfSection(void) size = 0; zero_bits = 1; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)ptr2 >> (32 - zero_bits)) + todo_wine_if(is_win64) ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0, "NtMapViewOfSection returned address: %p\n", ptr2);
@@ -275,12 +279,12 @@ static void test_MapViewOfSection(void) ptr2 = NULL; size = 0; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE); ok(status == STATUS_SUCCESS || status == STATUS_NO_MEMORY, "NtMapViewOfSection with %d zero_bits returned %08x\n", zero_bits, status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)ptr2 >> (32 - zero_bits)) + todo_wine ok(((UINT_PTR)ptr2 >> (32 - zero_bits)) == 0, "NtMapViewOfSection with %d zero_bits returned address %p\n", zero_bits, ptr2);
@@ -316,7 +320,7 @@ static void test_MapViewOfSection(void) size = 0; zero_bits = 0x1fffffff; offset.QuadPart = 0; - status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, 0, PAGE_READWRITE); + status = NtMapViewOfSection(mapping, process, &ptr2, zero_bits, 0, &offset, &size, 1, MEM_TOP_DOWN, PAGE_READWRITE);
if (!is_win64 && !is_wow64) { @@ -328,7 +332,7 @@ static void test_MapViewOfSection(void) "NtMapViewOfSection returned %08x\n", status); if (status == STATUS_SUCCESS) { - todo_wine_if((UINT_PTR)ptr2 & ~zero_bits) + todo_wine ok(((UINT_PTR)ptr2 & ~zero_bits) == 0, "NtMapViewOfSection returned address %p\n", ptr2);