Author: tfaber
Date: Thu Nov 10 10:18:25 2016
New Revision: 73190
URL:
http://svn.reactos.org/svn/reactos?rev=73190&view=rev
Log:
[NTDLL_APITEST]
- Add tests for RtlIsNameLegalDOS8Dot3 and RtlUpcaseUnicodeStringToCountedOemString with
the ® sign.
CORE-8617
Added:
trunk/rostests/apitests/ntdll/RtlIsNameLegalDOS8Dot3.c (with props)
trunk/rostests/apitests/ntdll/RtlUpcaseUnicodeStringToCountedOemString.c (with
props)
Modified:
trunk/rostests/apitests/ntdll/CMakeLists.txt
trunk/rostests/apitests/ntdll/testlist.c
Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/CMakeLists…
==============================================================================
--- trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] Thu Nov 10 10:18:25
2016
@@ -40,8 +40,10 @@
RtlGetLongestNtPathLength.c
RtlImageRvaToVa.c
RtlInitializeBitMap.c
+ RtlIsNameLegalDOS8Dot3.c
RtlMemoryStream.c
RtlReAllocateHeap.c
+ RtlUpcaseUnicodeStringToCountedOemString.c
StackOverflow.c
SystemInfo.c
Timer.c
Added: trunk/rostests/apitests/ntdll/RtlIsNameLegalDOS8Dot3.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlIsNameL…
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlIsNameLegalDOS8Dot3.c (added)
+++ trunk/rostests/apitests/ntdll/RtlIsNameLegalDOS8Dot3.c [iso-8859-1] Thu Nov 10
10:18:25 2016
@@ -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 <thomas.faber(a)reactos.org>
+ */
+
+#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]);
+
+}
Propchange: trunk/rostests/apitests/ntdll/RtlIsNameLegalDOS8Dot3.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/ntdll/RtlUpcaseUnicodeStringToCountedOemString.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlUpcaseU…
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlUpcaseUnicodeStringToCountedOemString.c (added)
+++ trunk/rostests/apitests/ntdll/RtlUpcaseUnicodeStringToCountedOemString.c
[iso-8859-1] Thu Nov 10 10:18:25 2016
@@ -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 <thomas.faber(a)reactos.org>
+ */
+
+#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]);
+}
Propchange: trunk/rostests/apitests/ntdll/RtlUpcaseUnicodeStringToCountedOemString.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/ntdll/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/testlist.c…
==============================================================================
--- trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] Thu Nov 10 10:18:25 2016
@@ -44,8 +44,10 @@
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 @@
{ "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 },