Author: pschweitzer
Date: Sun Sep 20 17:51:41 2015
New Revision: 69307
URL:
http://svn.reactos.org/svn/reactos?rev=69307&view=rev
Log:
[NTDLL_APITESTS]
Add more tests
Modified:
trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c
Modified: trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGenerat…
==============================================================================
--- trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/RtlGenerate8dot3Name.c [iso-8859-1] Sun Sep 20 17:51:41
2015
@@ -22,6 +22,8 @@
PWSTR Names[] = { L"Menu Démarrer", L"Sélecteur de configuration
clavier.lnk", L"éèà ùç.txt", L"éèà ùçeeauc.txt",
L"Long file name.txt", L"Long file name",
L"Longfilename.txt", L"Longfilename" };
PWSTR ShortNames1[] = { L"MENUDM~1", L"SLECTE~1.LNK",
L"5C2D~1.TXT", L"EEAUC~1.TXT", L"LONGFI~1.TXT",
L"LONGFI~1", L"LONGFI~1.TXT", L"LONGFI~1" };
PWSTR ShortNames2[] = { L"MENUDM~2", L"SLECTE~2.LNK",
L"5C2D~2.TXT", L"EEAUC~2.TXT", L"LONGFI~2.TXT",
L"LONGFI~2", L"LONGFI~2.TXT", L"LONGFI~2" };
+PWSTR ExShortNames1[] = { L"MENUDÃ~1", L"SÃLECT~1.LNK",
L"ÃÃÃÃÃ~1.TXT", L"ÃÃÃÃÃE~1.TXT", L"LONGFI~1.TXT",
L"LONGFI~1", L"LONGFI~1.TXT", L"LONGFI~1" };
+PWSTR ExShortNames2[] = { L"MENUDÃ~2", L"SÃLECT~2.LNK",
L"ÃÃÃÃÃ~2.TXT", L"ÃÃÃÃÃE~2.TXT", L"LONGFI~2.TXT",
L"LONGFI~2", L"LONGFI~2.TXT", L"LONGFI~2" };
START_TEST(RtlGenerate8dot3Name)
{
@@ -47,5 +49,16 @@
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);
+
+ RtlZeroMemory(&Context, sizeof(GENERATE_NAME_CONTEXT));
+ ShortName.Length = 0;
+ RtlGenerate8dot3Name(&LongName, TRUE, &Context, &ShortName);
+ RtlInitUnicodeString(&Expected, ExShortNames1[i]);
+ ok(RtlEqualUnicodeString(&Expected, &ShortName, FALSE), "Generated:
%.*S. Expected: %.*S\n", ShortName.Length, ShortName.Buffer, Expected.Length,
Expected.Buffer);
+
+ ShortName.Length = 0;
+ RtlGenerate8dot3Name(&LongName, TRUE, &Context, &ShortName);
+ RtlInitUnicodeString(&Expected, ExShortNames2[i]);
+ ok(RtlEqualUnicodeString(&Expected, &ShortName, FALSE), "Generated:
%.*S. Expected: %.*S\n", ShortName.Length, ShortName.Buffer, Expected.Length,
Expected.Buffer);
}
}