mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTDLL_APITESTS]
Add a test that shows that RtlAllocateHeap() totally ignores HEAP_CREATE_ALIGN_16 svn path=/trunk/; revision=69504
This commit is contained in:
parent
c0cd33da02
commit
7feed70d00
3 changed files with 40 additions and 0 deletions
|
@ -17,6 +17,7 @@ list(APPEND SOURCE
|
|||
NtQuerySystemEnvironmentValue.c
|
||||
NtQueryVolumeInformationFile.c
|
||||
NtSaveKey.c
|
||||
RtlAllocateHeap.c
|
||||
RtlBitmap.c
|
||||
RtlCopyMappedMemory.c
|
||||
RtlDetermineDosPathNameType.c
|
||||
|
|
37
rostests/apitests/ntdll/RtlAllocateHeap.c
Normal file
37
rostests/apitests/ntdll/RtlAllocateHeap.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* PROJECT: ReactOS api tests
|
||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
||||
* PURPOSE: Test for RtlAllocateHeap
|
||||
* PROGRAMMER: Pierre Schweitzer <pierre@reactos.org>
|
||||
*/
|
||||
|
||||
#include <apitest.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#include <ndk/rtlfuncs.h>
|
||||
|
||||
PVOID Buffers[0x100];
|
||||
|
||||
START_TEST(RtlAllocateHeap)
|
||||
{
|
||||
USHORT i;
|
||||
BOOLEAN Aligned = TRUE;
|
||||
|
||||
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))
|
||||
{
|
||||
Aligned = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 0x100; ++i)
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffers[i]);
|
||||
}
|
||||
|
||||
ok(Aligned == FALSE, "No unaligned address returned\n");
|
||||
}
|
|
@ -21,6 +21,7 @@ extern void func_NtQuerySystemEnvironmentValue(void);
|
|||
extern void func_NtQueryVolumeInformationFile(void);
|
||||
extern void func_NtSaveKey(void);
|
||||
extern void func_NtSystemInformation(void);
|
||||
extern void func_RtlAllocateHeap(void);
|
||||
extern void func_RtlBitmap(void);
|
||||
extern void func_RtlCopyMappedMemory(void);
|
||||
extern void func_RtlDetermineDosPathNameType(void);
|
||||
|
@ -60,6 +61,7 @@ const struct test winetest_testlist[] =
|
|||
{ "NtQueryVolumeInformationFile", func_NtQueryVolumeInformationFile },
|
||||
{ "NtSaveKey", func_NtSaveKey},
|
||||
{ "NtSystemInformation", func_NtSystemInformation },
|
||||
{ "RtlAllocateHeap", func_RtlAllocateHeap },
|
||||
{ "RtlBitmapApi", func_RtlBitmap },
|
||||
{ "RtlCopyMappedMemory", func_RtlCopyMappedMemory },
|
||||
{ "RtlDetermineDosPathNameType", func_RtlDetermineDosPathNameType },
|
||||
|
|
Loading…
Reference in a new issue