[NTDLL_APITEST]

- Add tests for RtlIsNameLegalDOS8Dot3 and RtlUpcaseUnicodeStringToCountedOemString with the ® sign.
CORE-8617

svn path=/trunk/; revision=73190
This commit is contained in:
Thomas Faber
2016-11-10 10:18:25 +00:00
parent 8632758e52
commit ac5bba8ea8
4 changed files with 72 additions and 0 deletions
+2
View File
@@ -40,8 +40,10 @@ list(APPEND SOURCE
RtlGetLongestNtPathLength.c
RtlImageRvaToVa.c
RtlInitializeBitMap.c
RtlIsNameLegalDOS8Dot3.c
RtlMemoryStream.c
RtlReAllocateHeap.c
RtlUpcaseUnicodeStringToCountedOemString.c
StackOverflow.c
SystemInfo.c
Timer.c
@@ -0,0 +1,35 @@
/*
* PROJECT: ReactOS API tests
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Test for RtlIsNameLegalDOS8Dot3
* PROGRAMMER: Thomas Faber <[email protected]>
*/
#include <apitest.h>
#define WIN32_NO_STATUS
#include <ndk/rtlfuncs.h>
START_TEST(RtlIsNameLegalDOS8Dot3)
{
UNICODE_STRING Name;
CHAR OemNameBuffer[13];
OEM_STRING OemName;
BOOLEAN NameContainsSpaces;
BOOLEAN IsLegal;
RtlInitUnicodeString(&Name, L"\x00ae");
RtlFillMemory(OemNameBuffer, sizeof(OemNameBuffer), 0x55);
OemName.Buffer = OemNameBuffer;
OemName.Length = 0;
OemName.MaximumLength = sizeof(OemNameBuffer);
NameContainsSpaces = 0x55;
IsLegal = RtlIsNameLegalDOS8Dot3(&Name, &OemName, &NameContainsSpaces);
ok(IsLegal == TRUE, "IsLegal = %u\n", IsLegal);
ok(NameContainsSpaces == FALSE, "NameContainsSpaces = %u\n", NameContainsSpaces);
ok(OemName.Length == 1, "OemName.Length = %u\n", OemName.Length);
ok(OemNameBuffer[0] == 'R', "OemNameBuffer[0] = 0x%x\n", OemNameBuffer[0]);
ok(OemNameBuffer[1] == 0x55, "OemNameBuffer[1] = 0x%x\n", OemNameBuffer[1]);
ok(OemNameBuffer[2] == 0x55, "OemNameBuffer[2] = 0x%x\n", OemNameBuffer[2]);
}
@@ -0,0 +1,31 @@
/*
* PROJECT: ReactOS API tests
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Test for RtlUpcaseUnicodeStringToCountedOemString
* PROGRAMMER: Thomas Faber <[email protected]>
*/
#include <apitest.h>
#define WIN32_NO_STATUS
#include <ndk/rtlfuncs.h>
START_TEST(RtlUpcaseUnicodeStringToCountedOemString)
{
NTSTATUS Status;
UNICODE_STRING Name;
CHAR OemNameBuffer[13];
OEM_STRING OemName;
RtlInitUnicodeString(&Name, L"\x00ae");
RtlFillMemory(OemNameBuffer, sizeof(OemNameBuffer), 0x55);
OemName.Buffer = OemNameBuffer;
OemName.Length = 0;
OemName.MaximumLength = sizeof(OemNameBuffer);
Status = RtlUpcaseUnicodeStringToCountedOemString(&OemName, &Name, FALSE);
ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
ok(OemName.Length == 1, "OemName.Length = %u\n", OemName.Length);
ok(OemNameBuffer[0] == 'R', "OemNameBuffer[0] = 0x%x\n", OemNameBuffer[0]);
ok(OemNameBuffer[1] == 0x55, "OemNameBuffer[1] = 0x%x\n", OemNameBuffer[1]);
ok(OemNameBuffer[2] == 0x55, "OemNameBuffer[2] = 0x%x\n", OemNameBuffer[2]);
}
+4
View File
@@ -44,8 +44,10 @@ extern void func_RtlGetLengthWithoutTrailingPathSeperators(void);
extern void func_RtlGetLongestNtPathLength(void);
extern void func_RtlImageRvaToVa(void);
extern void func_RtlInitializeBitMap(void);
extern void func_RtlIsNameLegalDOS8Dot3(void);
extern void func_RtlMemoryStream(void);
extern void func_RtlReAllocateHeap(void);
extern void func_RtlUpcaseUnicodeStringToCountedOemString(void);
extern void func_StackOverflow(void);
extern void func_TimerResolution(void);
@@ -92,8 +94,10 @@ const struct test winetest_testlist[] =
{ "RtlGetLongestNtPathLength", func_RtlGetLongestNtPathLength },
{ "RtlImageRvaToVa", func_RtlImageRvaToVa },
{ "RtlInitializeBitMap", func_RtlInitializeBitMap },
{ "RtlIsNameLegalDOS8Dot3", func_RtlIsNameLegalDOS8Dot3 },
{ "RtlMemoryStream", func_RtlMemoryStream },
{ "RtlReAllocateHeap", func_RtlReAllocateHeap },
{ "RtlUpcaseUnicodeStringToCountedOemString", func_RtlUpcaseUnicodeStringToCountedOemString },
{ "StackOverflow", func_StackOverflow },
{ "TimerResolution", func_TimerResolution },