A few more conformance tests for heap memory allocation.

This commit is contained in:
Andriy Palamarchuk 2002-09-11 00:48:47 +00:00 committed by Alexandre Julliard
parent 63709f07f9
commit 025b52d950
1 changed files with 21 additions and 0 deletions

View File

@ -54,6 +54,7 @@ static void test_Heap(void)
LPVOID mem1,mem1a,mem3;
UCHAR *mem2,*mem2a;
UINT error,i;
DWORD dwSize;
/* Retreive the page size for this system */
sysInfo.dwPageSize=0;
@ -147,6 +148,26 @@ static void test_Heap(void)
ok(HeapFree(heap,(DWORD)NULL,mem2),"HeapFree failed");
}
/* take just freed pointer */
if (mem1a)
mem1 = mem1a;
/* try to free it one more time */
HeapFree(heap, 0, mem1);
dwSize = HeapSize(heap, 0, mem1);
ok(dwSize == 0xFFFFFFFF, "The size");
/* 0-length buffer */
mem1 = HeapAlloc(heap, 0, 0);
ok(mem1 != NULL, "Reserved memory");
dwSize = HeapSize(heap, 0, mem1);
/* should work with 0-length buffer */
ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),
"The size of the 0-length buffer");
ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer");
/* Check that HeapDestry works */
ok(HeapDestroy(heap),"HeapDestroy failed");
}