Robert Shearman R.J.Shearman@warwick.ac.uk writes:
+void test_StrCmpA(void) +{
- static const char str1[] = {'a','b','c','d','e','f',0x81,'a',0};
- static const char str2[] = {'a','b','c','d','e','f',0x81,'b',0};
- static const char str3[] = {'a','B','c','d','e','f',0x81,'a',0};
- WORD dbcs1 = 0x81 | 'a' << 8;
- WORD dbcs2 = 0x81 | 'b' << 8;
DBCS chars depend on the locale, you cannot hardcode them in the test.
Alexandre Julliard wrote:
DBCS chars depend on the locale, you cannot hardcode them in the test.
Any way of generating them based on the locale or should I just remove the DBCS tests?
-- Alexandre Julliard julliard@winehq.com
Rob
"Robert Shearman" R.J.Shearman@warwick.ac.uk writes:
Any way of generating them based on the locale or should I just remove the DBCS tests?
You could use IsDBCSLeadByte and friends, but most locales don't have DBCS chars at all so it wouldn't help much. An alternative would be to switch to a DBCS locale for that test, but I'm not sure if that would work under all versions of Windows.
Robert Shearman wrote:
Alexandre Julliard wrote:
DBCS chars depend on the locale, you cannot hardcode them in the test.
Any way of generating them based on the locale or should I just remove the DBCS tests?
DBCS is only meant to work if the current locale is an MBCS locale. What I would try and do is perhaps hard code the Unicode characters, and convert them to ANSI in runtime. This will let you know whether the current locale has the relevant characters or not.
I'm not familiar with the exact semantics of the CJK setup, so I can't tell you whether there is a single Unicode character that exists in all MBCS locales. In any case, whatever you decide, take into account the fact that an English setup will, most likely, fail this test.
Shachar