[PATCH 1/4] comctl32/tooltips: Fix an obviously wrong structure size check (try2)

Nikolay Sivov bunglehead at gmail.com
Mon Oct 19 05:36:05 CDT 2009


Paul Vriens wrote:
> On 10/15/2009 12:59 PM, Nikolay Sivov wrote:
>> Changelog:
>>      - try2: fixed usage of W calls in tests, fixed some typos
>>      - fix an obviously wrong structure size check
>>
>
> Hi Nikolay,
>
> I have been checking the failures for these tests. At first I just 
> wanted to add some broken() statements.
>
> Looking at test.winehq.org I can see that the test failure output is 
> different sometimes. Changing the following for every call:
>
> ti.cbSize = TTTOOLINFO[AW]_V2_SIZE - sizeof(void*);
>
> make the output consistent (still different from comctl32 > 5.81).
This makes TTTOOLINFO[AW]_V2_SIZE - sizeof(void*) == TTTOOLINFO[AW]_V1_SIZE.
So test doesn't make sense after such modification. It's better to mark 
it broken. This size check doesn't seem to be consistent
at all.
>
> What would be the best way to fix these tests? Add a define for the 
> size of the struct that differs between "_WIN32_WINNT >= 0x0501" and 
> the earlier versions and then have a second possible result (or 
> broken())?
For example for Win95 we should skip the rest of the test with V2 and 
higher after this failure:

 432     ti.cbSize = TTTOOLINFOA_V2_SIZE;
 433     ti.hwnd = NULL;
 434     ti.hinst = GetModuleHandleA(NULL);
 435     ti.uFlags = 0;
 436     ti.uId = 0x1234ABCD;
 437     ti.lpszText = NULL;
 438     ti.lParam = 0xdeadbeef;
 439     GetClientRect(hwnd, &ti.rect);
 440     r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
 441     ok(r, "Adding the tool to the tooltip failed\n");

> tooltips.c:441 
> <http://source.winehq.org/git/wine.git/?a=blob;f=dlls/comctl32/tests/tooltips.c;hb=8c743cb25f2d2c6257f0786b887422d485e84eb3#l441>: 
> Test failed: Adding the tool to the tooltip failed
it indicates that V2 isn't supported.
>
> Another thing is that this test doesn't have any ok()'s, what was the 
> intention here?:
>
> 457     ti.cbSize = TTTOOLINFOA_V2_SIZE;
> 458     ti.uId = 0x1234ABCD;
> 459     ti.lParam = 0xaaaaaaaa;
> 460     r = SendMessageA(hwnd, TTM_SETTOOLINFOA, 0, (LPARAM)&ti);
It's just to revert back to 0xaaaaaaaa lParam, not very useful though. 
MSDN tells it doesn't return any reasonable
in this case, so feel free to remove assignment to r.



More information about the wine-devel mailing list