[NTDLL_APITESTS]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 20 Sep 2015 17:51:41 +0000 (17:51 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 20 Sep 2015 17:51:41 +0000 (17:51 +0000)
Add more tests

svn path=/trunk/; revision=69307

rostests/apitests/ntdll/RtlGenerate8dot3Name.c

index 22a9a03..f83ce00 100644 (file)
@@ -22,6 +22,8 @@ RtlGenerate8dot3Name(
 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 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)
 {
 
 START_TEST(RtlGenerate8dot3Name)
 {
@@ -47,5 +49,16 @@ START_TEST(RtlGenerate8dot3Name)
         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);
         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);
     }
 }
     }
 }