mirror of
https://github.com/reactos/reactos.git
synced 2024-08-29 22:58:34 +00:00
34 lines
1,014 B
C
34 lines
1,014 B
C
![]() |
/*
|
||
|
* PROJECT: ReactOS API tests
|
||
|
* LICENSE: 0BSD (https://spdx.org/licenses/0BSD.html)
|
||
|
* PURPOSE: Test for RtlxUnicodeStringToOemSize
|
||
|
* COPYRIGHT: Copyright 2021 Jérôme Gardou <jerome.gardou@reactos.org>
|
||
|
*/
|
||
|
|
||
|
#include "precomp.h"
|
||
|
|
||
|
static const struct
|
||
|
{
|
||
|
ULONG AnsiCp;
|
||
|
ULONG OemCp;
|
||
|
PCWSTR Str;
|
||
|
ULONG OemLength;
|
||
|
} TestData[] =
|
||
|
{
|
||
|
{ 1252, 932, L"\u30c7\u30b9\u30af\u30c8\u30c3\u30d7", 7 }, /* "Desktop" in Japanese */
|
||
|
{ 932, 1252, L"\u30c7\u30b9\u30af\u30c8\u30c3\u30d7", 13 }, /* "Desktop" in Japanese */
|
||
|
};
|
||
|
|
||
|
START_TEST(RtlxUnicodeStringToOemSize)
|
||
|
{
|
||
|
for (int i = 0; i < _countof(TestData); i++)
|
||
|
{
|
||
|
SetupLocale(TestData[i].AnsiCp, TestData[i].OemCp, -1);
|
||
|
UNICODE_STRING Ustr;
|
||
|
RtlInitUnicodeString(&Ustr, TestData[i].Str);
|
||
|
ULONG Length = RtlxUnicodeStringToOemSize(&Ustr);
|
||
|
ok(Length == TestData[i].OemLength, "Wrong OEM length for test %u, expected %u, got %u\n",
|
||
|
i, (UINT)TestData[i].OemLength, (UINT)Length);
|
||
|
}
|
||
|
}
|