[comctl32/tests] Fix some test failures

Nikolay Sivov bunglehead at gmail.com
Thu Oct 1 08:28:24 CDT 2009


Paul Vriens wrote:
> On 10/01/2009 02:58 PM, Nikolay Sivov wrote:
>> Yes, please. If a problem is only in rectangle orders it's very simple
>> to fix (test for yyyy in returned locale data). I suggest not to drop
>> tests yet, we'll probably want to drop them later when trying probable
>> dpi-dependent failures.
>
> Well I need to test for all possible occurrences of month and year. So 
> something like:
>
> /* Get the format of the title */
> len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, NULL, 0);
> yearmonth = HeapAlloc(GetProcessHeap(), 0, len);
> GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, yearmonth, len);
> /* Find out the order */
> year = strstr(yearmonth, "y");
> month = strstr(yearmonth, "M");
>
> if (month < year) trace("Month before year\n");
> else trace("Year before month\n");
> HeapFree(GetProcessHeap(), 0, yearmonth);
Yes, not all possible actually, only month < year condition matters. 
It's better to use yyyy pattern cause some locales add
extra words in this format string. Also a static char[80] buffer should 
be used to simplify things (btw, MSDN says about 80 character length for 
all locale data, but we currently use much shorter in some cases - about 
10, 30 or so. Unfortunately there's no way to check this max length 
value, cause it's more like a max resource length. Anyway I'm going to 
use this value in next patch set maybe cause it's documented at least 
and isn't so magic like ours).
>
> The 3 tests I removed with the first patch can be removed safely as 
> all should be tested in the loop.
>
> Now I need to change the way we test to cope with:
> - order of year/month
Ok.
> - text right after the prev button or right before the next button
Not sure what you mean here. Isn't it the same as order?




More information about the wine-devel mailing list