10a8b51daSJérôme Gardou /*
20a8b51daSJérôme Gardou  * PROJECT:     ReactOS API tests
3*e944dfa7SHermès Bélusca-Maïto  * LICENSE:     0BSD (https://spdx.org/licenses/0BSD)
40a8b51daSJérôme Gardou  * PURPOSE:     Test for RtlxUnicodeStringToOemSize
50a8b51daSJérôme Gardou  * COPYRIGHT:   Copyright 2021 Jérôme Gardou <jerome.gardou@reactos.org>
60a8b51daSJérôme Gardou  */
70a8b51daSJérôme Gardou 
80a8b51daSJérôme Gardou #include "precomp.h"
90a8b51daSJérôme Gardou 
100a8b51daSJérôme Gardou static const struct
110a8b51daSJérôme Gardou {
120a8b51daSJérôme Gardou     ULONG AnsiCp;
130a8b51daSJérôme Gardou     ULONG OemCp;
140a8b51daSJérôme Gardou     PCWSTR Str;
150a8b51daSJérôme Gardou     ULONG OemLength;
160a8b51daSJérôme Gardou } TestData[] =
170a8b51daSJérôme Gardou {
180a8b51daSJérôme Gardou     { 1252, 932, L"\u30c7\u30b9\u30af\u30c8\u30c3\u30d7", 7 }, /* "Desktop" in Japanese */
190a8b51daSJérôme Gardou     { 932, 1252, L"\u30c7\u30b9\u30af\u30c8\u30c3\u30d7", 13 }, /* "Desktop" in Japanese */
200a8b51daSJérôme Gardou };
210a8b51daSJérôme Gardou 
START_TEST(RtlxUnicodeStringToOemSize)220a8b51daSJérôme Gardou START_TEST(RtlxUnicodeStringToOemSize)
230a8b51daSJérôme Gardou {
240a8b51daSJérôme Gardou     for (int i = 0; i < _countof(TestData); i++)
250a8b51daSJérôme Gardou     {
260a8b51daSJérôme Gardou         SetupLocale(TestData[i].AnsiCp, TestData[i].OemCp, -1);
270a8b51daSJérôme Gardou         UNICODE_STRING Ustr;
280a8b51daSJérôme Gardou         RtlInitUnicodeString(&Ustr, TestData[i].Str);
290a8b51daSJérôme Gardou         ULONG Length = RtlxUnicodeStringToOemSize(&Ustr);
300a8b51daSJérôme Gardou         ok(Length == TestData[i].OemLength, "Wrong OEM length for test %u, expected %u, got %u\n",
310a8b51daSJérôme Gardou            i, (UINT)TestData[i].OemLength, (UINT)Length);
320a8b51daSJérôme Gardou     }
330a8b51daSJérôme Gardou }
34