2 * PROJECT: ReactOS api tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Tests for IsDBCSLeadByteEx
5 * PROGRAMMER: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
10 #define WIN32_NO_STATUS
12 #define COM_NO_WINDOWS_H
29 RANGE Ranges
[MAX_RANGE
];
32 START_TEST(IsDBCSLeadByteEx
)
34 static const ENTRY Entries
[] =
41 "ChineseSimpilified", 936,
48 "ChineseTraditional", 950,
58 { 0x81, 0x9F }, { 0xE0, 0xFC }
71 for (i
= 0; i
< _countof(Entries
); ++i
)
74 int CodePage
= Entries
[i
].CodePage
, StartIndex
= 0, RangeCount
= 0;
76 RANGE Ranges
[MAX_RANGE
];
77 const char *Name
= Entries
[i
].Name
;
79 ZeroMemory(&Ranges
, sizeof(Ranges
));
81 for (Index
= 0; Index
< 256; ++Index
)
85 if (!IsDBCSLeadByteEx(CodePage
, Index
))
87 Ranges
[RangeCount
].StartIndex
= StartIndex
;
88 Ranges
[RangeCount
].EndIndex
= Index
- 1;
95 if (IsDBCSLeadByteEx(CodePage
, Index
))
104 Ranges
[RangeCount
].StartIndex
= StartIndex
;
105 Ranges
[RangeCount
].EndIndex
= Index
- 1;
109 ok(RangeCount
== Entries
[i
].RangeCount
,
110 "%s: RangeCount expected %d, was %d\n",
111 Name
, Entries
[i
].RangeCount
, RangeCount
);
112 for (iRange
= 0; iRange
< Entries
[i
].RangeCount
; ++iRange
)
114 const RANGE
*pRange
= &Entries
[i
].Ranges
[iRange
];
115 int iStart
= Ranges
[iRange
].StartIndex
;
116 int iEnd
= Ranges
[iRange
].EndIndex
;
117 ok(iStart
== pRange
->StartIndex
,
118 "%s: Ranges[%d].StartIndex expected: 0x%02X, was: 0x%02X\n",
119 Name
, iRange
, pRange
->StartIndex
, iStart
);
120 ok(iEnd
== pRange
->EndIndex
,
121 "%s: Ranges[%d].EndIndex was expected: 0x%02X, was: 0x%02X\n",
122 Name
, iRange
, pRange
->EndIndex
, iEnd
);