ReactOS 0.4.15-dev-8219-ge8b88cf
LCMapString.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Tests for LCMapString
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6 */
7
8#include "precomp.h"
9
10#undef ok_wstr_
11
12static void
13ok_wstr_(const char *file, int line, LPCWSTR x, LPCWSTR y)
14{
15 char buf1[100], buf2[100];
16 lstrcpynA(buf1, wine_dbgstr_w(x), _countof(buf1));
17 lstrcpynA(buf2, wine_dbgstr_w(y), _countof(buf2));
18 ok_(file, line)(wcscmp(x, y) == 0, "Wrong string. Expected %s, got %s\n", buf2, buf1);
19}
20
21#undef ok_wstr
22#define ok_wstr(x, y) ok_wstr_(__FILE__, __LINE__, x, y)
23
24// "ABab12ABab12あアばバパ万萬" in UTF-16
25static const WCHAR c_target[] =
26 L"ABab12\xff21\xff22\xff41\xff42\xff11\xff12\x3042\x30a2\x3070\x30d0\xff8a\xff9f\x4e07\x842c";
27
28static void TEST_LCMapStringW(void)
29{
30 WCHAR results[100];
31
33 ok_wstr(results, L"\xff21\xff22\xff41\xff42\xff11\xff12\xff21\xff22\xff41\xff42\xff11\xff12\x3042\x30a2\x3070\x30d0\x30d1\x4e07\x842c");
34
36 ok_wstr(results, L"ABab12ABab12\x3042\xff71\x3070\xff8a\xff9e\xff8a\xff9f\x4e07\x842c");
37
39 ok_wstr(results, L"ABab12\xff21\xff22\xff41\xff42\xff11\xff12\x3042\x3042\x3070\x3070\xff8a\xff9f\x4e07\x842c");
40
42 ok_wstr(results, L"ABab12\xff21\xff22\xff41\xff42\xff11\xff12\x30a2\x30a2\x30d0\x30d0\xff8a\xff9f\x4e07\x842c");
43
45 ok_wstr(results, L"abab12\xff41\xff42\xff41\xff42\xff11\xff12\x3042\x30a2\x3070\x30d0\xff8a\xff9f\x4e07\x842c");
46
48 ok_wstr(results, L"ABAB12\xff21\xff22\xff21\xff22\xff11\xff12\x3042\x30a2\x3070\x30d0\xff8a\xff9f\x4e07\x842c");
49
51 ok_wstr(results, L"ABab12\xff21\xff22\xff41\xff42\xff11\xff12\x3042\x30a2\x3070\x30d0\xff8a\xff9f\x4e07\x4e07");
52
54 ok_wstr(results, L"ABab12\xff21\xff22\xff41\xff42\xff11\xff12\x3042\x30a2\x3070\x30d0\xff8a\xff9f\x842c\x842c");
55}
56
58{
60}
static void TEST_LCMapStringW(void)
Definition: LCMapString.c:28
#define ok_wstr(x, y)
Definition: LCMapString.c:22
static const WCHAR c_target[]
Definition: LCMapString.c:25
static struct _test_info results[8]
Definition: SetCursorPos.c:31
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define lstrcpynA
Definition: compat.h:751
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
Definition: locale.c:3804
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define wine_dbgstr_w
Definition: kernel32.h:34
#define L(x)
Definition: ntvdm.h:50
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define ok_wstr_(file, line, x, y)
Definition: test.h:989
#define _countof(array)
Definition: sndvol32.h:70
Definition: fci.c:127
Definition: parser.c:49
#define LCMAP_SIMPLIFIED_CHINESE
Definition: winnls.h:193
#define LCMAP_TRADITIONAL_CHINESE
Definition: winnls.h:194
#define LCMAP_HALFWIDTH
Definition: winnls.h:190
#define LCMAP_HIRAGANA
Definition: winnls.h:188
#define LCMAP_UPPERCASE
Definition: winnls.h:185
#define LCMAP_LOWERCASE
Definition: winnls.h:184
#define LCMapString
Definition: winnls.h:1190
#define LCMAP_KATAKANA
Definition: winnls.h:189
#define LCMAP_FULLWIDTH
Definition: winnls.h:191
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185