Author: pschweitzer Date: Sun Oct 11 21:49:16 2015 New Revision: 69506
URL: http://svn.reactos.org/svn/reactos?rev=69506&view=rev Log: [NTDLL_APITESTS] Extend the RtlAllocateHeap() test
Modified: trunk/rostests/apitests/ntdll/RtlAllocateHeap.c
Modified: trunk/rostests/apitests/ntdll/RtlAllocateHeap.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlAllocate... ============================================================================== --- trunk/rostests/apitests/ntdll/RtlAllocateHeap.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlAllocateHeap.c [iso-8859-1] Sun Oct 11 21:49:16 2015 @@ -15,11 +15,12 @@ START_TEST(RtlAllocateHeap) { USHORT i; + HANDLE hHeap; BOOLEAN Aligned = TRUE; + RTL_HEAP_PARAMETERS Parameters = {0};
for (i = 0; i < 0x100; ++i) { - SetLastError(0xdeadbeef); Buffers[i] = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_CREATE_ALIGN_16, (i % 16 ) + 1); ASSERT(Buffers[i] != NULL); if (!((ULONG_PTR)Buffers[i] & 0x2)) @@ -34,4 +35,31 @@ }
ok(Aligned == FALSE, "No unaligned address returned\n"); + + Aligned = TRUE; + Parameters.Length = sizeof(Parameters); + hHeap = RtlCreateHeap(HEAP_CREATE_ALIGN_16, NULL, 0, 0, NULL, &Parameters); + if (hHeap == NULL) + { + return; + } + + for (i = 0; i < 0x100; ++i) + { + Buffers[i] = RtlAllocateHeap(RtlGetProcessHeap(), 0, (i % 16 ) + 1); + ASSERT(Buffers[i] != NULL); + if (!((ULONG_PTR)Buffers[i] & 0x2)) + { + Aligned = FALSE; + } + } + + for (i = 0; i < 0x100; ++i) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffers[i]); + } + + RtlDestroyHeap(hHeap); + + ok(Aligned == FALSE, "No unaligned address returned\n"); }