kernel32/tests: Test HeapReAlloc with size 0.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2017-04-04 14:52:14 +02:00 committed by Alexandre Julliard
parent b709998f85
commit 14e7febc52
1 changed files with 7 additions and 0 deletions
dlls/kernel32/tests

View File

@ -118,6 +118,13 @@ static void test_heap(void)
HeapFree(GetProcessHeap(), 0, mem);
mem = HeapAlloc(GetProcessHeap(), 0, ~(SIZE_T)0);
ok(mem == NULL, "memory allocated for size ~0\n");
mem = HeapAlloc(GetProcessHeap(), 0, 17);
msecond = HeapReAlloc(GetProcessHeap(), 0, mem, 0);
ok(msecond != NULL, "HeapReAlloc(0) should have succeeded\n");
size = HeapSize(GetProcessHeap(), 0, msecond);
ok(size == 0 || broken(size == 1) /* some vista and win7 */,
"HeapSize should have returned 0 instead of %lu\n", size);
HeapFree(GetProcessHeap(), 0, msecond);
/* large blocks must be 16-byte aligned */
mem = HeapAlloc(GetProcessHeap(), 0, 512 * 1024);