Commit 1e624c5a authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

kernel32/tests: Ensure VirtualAlloc tests do not depend on previous memory allocations.

Following tests try to allocate memory at (char *)addr1 + 0x1000. We expect that no memory is mapped at this location. Signed-off-by: 's avatarSebastian Lackner <sebastian@fds-team.de> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 24641d8e
......@@ -383,9 +383,13 @@ static void test_VirtualAlloc(void)
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n");
addr1 = VirtualAlloc(0, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
/* memory returned by VirtualAlloc should be aligned to 64k */
addr1 = VirtualAlloc(0, 0x2000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
ok(addr1 != NULL, "VirtualAlloc failed\n");
ok(!((ULONG_PTR)addr1 & 0xffff), "returned memory %p is not aligned to 64k\n", addr1);
ok(VirtualFree(addr1, 0, MEM_RELEASE), "VirtualFree failed\n");
addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
ok(addr2 == addr1, "VirtualAlloc returned %p, expected %p\n", addr2, addr1);
/* allocation conflicts because of 64k align */
size = 0x1000;
......
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