Author: pschweitzer
Date: Sun Sep 20 10:42:05 2015
New Revision: 69303
URL:
http://svn.reactos.org/svn/reactos?rev=69303&view=rev
Log:
[NTDLL_APITESTS]
Add a few tests for RtlGenerate8dot3Name()
Added:
trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.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] Sun Sep 20 10:42:05 2015
@@ -22,6 +22,7 @@
RtlDosPathNameToNtPathName_U.c
RtlDosSearchPath_U.c
RtlDosSearchPath_Ustr.c
+ RtlGenerate8dot3Name.c
RtlGetFullPathName_U.c
RtlGetFullPathName_Ustr.c
RtlGetFullPathName_UstrEx.c
Added: trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGenerat…
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c (added)
+++ trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c [iso-8859-1] Sun Sep 20 10:42:05
2015
@@ -0,0 +1,50 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Test for RtlGenerate8dot3Name
+ * PROGRAMMER: Pierre Schweitzer <pierre(a)reactos.org>
+ */
+
+#include <apitest.h>
+
+#define WIN32_NO_STATUS
+#include <ndk/rtlfuncs.h>
+
+NTSYSAPI
+VOID
+NTAPI
+RtlGenerate8dot3Name(
+ _In_ PCUNICODE_STRING Name,
+ _In_ BOOLEAN AllowExtendedCharacters,
+ _Inout_ PGENERATE_NAME_CONTEXT Context,
+ _Inout_ PUNICODE_STRING Name8dot3);
+
+PWSTR Names[] = { L"Menu Démarrer", L"Sélecteur de configuration
clavier.lnk", L"éèà ùç.txt", L"éèà ùçeeauc.txt" };
+PWSTR ShortNames1[] = { L"MENUDM~1", L"SLECTE~1.LNK",
L"5C2D~1.TXT", L"EEAUC~1.TXT" };
+PWSTR ShortNames2[] = { L"MENUDM~2", L"SLECTE~2.LNK",
L"5C2D~2.TXT", L"EEAUC~2.TXT" };
+
+START_TEST(RtlGenerate8dot3Name)
+{
+ USHORT i;
+
+ for (i = 0; i < 4; ++i)
+ {
+ WCHAR Buffer[12];
+ GENERATE_NAME_CONTEXT Context;
+ UNICODE_STRING LongName, ShortName, Expected;
+
+ RtlZeroMemory(&Context, sizeof(GENERATE_NAME_CONTEXT));
+ RtlInitUnicodeString(&LongName, Names[i]);
+ ShortName.Buffer = Buffer;
+ ShortName.Length = sizeof(Buffer);
+ ShortName.MaximumLength = sizeof(Buffer);
+
+ RtlGenerate8dot3Name(&LongName, FALSE, &Context, &ShortName);
+ RtlInitUnicodeString(&Expected, ShortNames1[i]);
+ ok(RtlEqualUnicodeString(&Expected, &ShortName, FALSE), "Generated:
%.*S. Expected: %.*S\n", ShortName.Length, ShortName.Buffer, Expected.Length,
Expected.Buffer);
+
+ RtlGenerate8dot3Name(&LongName, FALSE, &Context, &ShortName);
+ RtlInitUnicodeString(&Expected, ShortNames2[i]);
+ ok(RtlEqualUnicodeString(&Expected, &ShortName, FALSE), "Generated:
%.*S. Expected: %.*S\n", ShortName.Length, ShortName.Buffer, Expected.Length,
Expected.Buffer);
+ }
+}
Propchange: trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.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] Sun Sep 20 10:42:05 2015
@@ -26,6 +26,7 @@
extern void func_RtlDosPathNameToNtPathName_U(void);
extern void func_RtlDosSearchPath_U(void);
extern void func_RtlDosSearchPath_Ustr(void);
+extern void func_RtlGenerate8dot3Name(void);
extern void func_RtlGetFullPathName_U(void);
extern void func_RtlGetFullPathName_Ustr(void);
extern void func_RtlGetFullPathName_UstrEx(void);
@@ -62,6 +63,7 @@
{ "RtlDosPathNameToNtPathName_U", func_RtlDosPathNameToNtPathName_U },
{ "RtlDosSearchPath_U", func_RtlDosSearchPath_U },
{ "RtlDosSearchPath_Ustr", func_RtlDosSearchPath_Ustr },
+ { "RtlGenerate8dot3Name", func_RtlGenerate8dot3Name },
{ "RtlGetFullPathName_U", func_RtlGetFullPathName_U },
{ "RtlGetFullPathName_Ustr", func_RtlGetFullPathName_Ustr },
{ "RtlGetFullPathName_UstrEx", func_RtlGetFullPathName_UstrEx },