[kernel32][tests][locale] Add test for CompareStringA for non latin symbols

Anatoly Lyutin vostok at etersoft.ru
Thu Jan 25 04:53:39 CST 2007


Dmitry Timoshkov wrote:
> "Anatoly Lyutin" <vostok at etersoft.ru> wrote:
>
>> --- dlls/kernel32/tests/locale.c 5 Jan 2007 19:37:02 -0000 1.8
>> +++ dlls/kernel32/tests/locale.c 24 Jan 2007 14:15:14 -0000
>> @@ -35,6 +35,9 @@
>> #include "winerror.h"
>> #include "winnls.h"
>>
>> +#include "locale.h"
>> +#include "tables_CP1251.h"
>
> I'd suggest to test specific strings instead of auto-generated tables.
> Since microsoft apparently uses their own unicode tables that differ
> from unicode.org ones that's almost impossible to get the exactly same
> behaviour among Wine and Windows.
>
Unfortunately there are programs which  are using this table of sorting 
and  no other.
>> +static int compare_string2_non_latin(const void *e1, const void *e2)
>> +{
>> +    const char *s1 = (char *)e1;
>> +    const char *s2 = (char *)e2;
>> +
>> +   return CompareStringA(LOCALE_USER_DEFAULT,0,s1,1, s2,1) - 2;
>> +}
>
> You need to directly specify the locale id, otherwise the test won't pass
> on a system with different user default locale (like the Alexandre's 
> one).
>

In:

+
+    while(Locales[j].pcTable)
+    {
+        if(setlocale(LC_ALL,Locales[j].pcLocalName)!=NULL)
+        {
+            for(i=0;i<cSize;i++)


set another locale, isn't it?




More information about the wine-devel mailing list