[1/2] comctl32/tests: Added tests for mouse events handling (try 3)

Dmitry Timoshkov dmitry at baikal.ru
Sun Apr 8 02:03:09 CDT 2012


Daniel Jelinski <djelinski1 at gmail.com> wrote:

> Skipping tests on WinNT - older versions of comctl send a different
> set of events.

Then you need to figure out what is different, and make the tests pass
there as well (there is 'optional' flag for that), otherwise you risk
breaking applications written for NT.

> +    /* WM_RBUTTONDOWN does not return until it gets another mouse event.
> +    Make sure it gets one by posting WM_RBUTTONUP to message queue */
> +    PostMessageA(hTree, WM_RBUTTONUP, 0, (LPARAM)0x10001);
> +    /* this sequence should NOT send WM_CONTEXTMENU */
> +    SendMessageA(hTree, WM_RBUTTONDOWN, 2, (LPARAM)0x10001);
> +
> +    /* ditch the first sequence as it processed more messages than we need. Redo */
> +    flush_sequences(sequences, NUM_MSG_SEQUENCES);
> +
> +    PostMessageA(hTree, WM_RBUTTONUP, 0, (LPARAM)0x10001);
> +    SendMessageA(hTree, WM_RBUTTONDOWN, 2, (LPARAM)0x10001);

This can't work. If you use PostMessage you need to flush message queue before
testing the sequence. Using SendMessage after PostMessage doesn't guarantee
that a posted message is handled before a sent one, you may try generating
hardware messages instead.

> +
> +    if(sequences[PARENT_SEQ_INDEX]->sequence->message == 0x133)
> +    {
> +        win_skip("Comctl32 versions prior to 5.80 send different set of events");
> +        return;
> +    }

Please use symbolic names for messages instead of magic numbers.

-- 
Dmitry.



More information about the wine-devel mailing list