Michael Stefaniuc : kernel32/tests: Test HeapReAlloc with size 0.

Alexandre Julliard julliard at winehq.org
Tue Apr 4 14:54:53 CDT 2017


Module: wine
Branch: master
Commit: 14e7febc52a2dc33e65ec85862867149aea0d5eb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=14e7febc52a2dc33e65ec85862867149aea0d5eb

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue Apr  4 14:52:14 2017 +0200

kernel32/tests: Test HeapReAlloc with size 0.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/heap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c
index 2f7edc8..0acf109 100644
--- a/dlls/kernel32/tests/heap.c
+++ b/dlls/kernel32/tests/heap.c
@@ -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);




More information about the wine-cvs mailing list