Commit 9f12d226 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

[Global|Local]ReAlloc don't fail with size 0.

Fixed typos.
parent 7d7ce505
......@@ -46,8 +46,13 @@ START_TEST(heap)
ok(gbl != NULL, "Can't realloc global memory");
size = GlobalSize(gbl);
ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%ld", size);
gbl = GlobalReAlloc(gbl, 0, GMEM_MOVEABLE);
ok(gbl == NULL, "GlobalReAlloc should fail on size 0, instead size=%ld", size);
todo_wine
{
gbl = GlobalReAlloc(gbl, 0, GMEM_MOVEABLE);
ok(gbl != NULL, "GlobalReAlloc should not fail on size 0");
}
size = GlobalSize(gbl);
ok(size == 0, "Memory not resized to size 0, instead size=%ld", size);
ok(GlobalFree(gbl) == NULL, "Memory not freed");
......@@ -59,14 +64,19 @@ START_TEST(heap)
/* Local*() functions */
gbl = LocalAlloc(GMEM_MOVEABLE, 0);
ok(gbl != NULL, "global memory not allocated for size 0");
ok(gbl != NULL, "local memory not allocated for size 0");
gbl = LocalReAlloc(gbl, 10, GMEM_MOVEABLE);
ok(gbl != NULL, "Can't realloc global memory");
ok(gbl != NULL, "Can't realloc local memory");
size = LocalSize(gbl);
ok(size >= 10 && size <= 16, "Memory not resized to size 10, instead size=%ld", size);
gbl = LocalReAlloc(gbl, 0, GMEM_MOVEABLE);
ok(gbl == NULL, "LocalReAlloc should fail on size 0, instead size=%ld", size);
todo_wine
{
gbl = LocalReAlloc(gbl, 0, GMEM_MOVEABLE);
ok(gbl != NULL, "LocalReAlloc should not fail on size 0");
}
size = LocalSize(gbl);
ok(size == 0, "Memory not resized to size 0, instead size=%ld", size);
ok(LocalFree(gbl) == NULL, "Memory not freed");
......@@ -74,6 +84,6 @@ START_TEST(heap)
ok(size == 0, "Memory should have been freed, size=%ld", size);
gbl = LocalReAlloc(0, 10, GMEM_MOVEABLE);
ok(gbl == NULL, "global realloc allocated memory");
ok(gbl == NULL, "local realloc allocated memory");
}
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