Dmitry Timoshkov : comctl32/tests: Add a test for notification messages order in the monthcal control.
Alexandre Julliard
julliard at winehq.org
Fri Feb 7 15:41:07 CST 2020
Module: wine
Branch: master
Commit: a4e29e9f5b0e6eb51fe8ab130c273b02362dadba
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a4e29e9f5b0e6eb51fe8ab130c273b02362dadba
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Fri Jan 24 15:24:56 2020 +0800
comctl32/tests: Add a test for notification messages order in the monthcal control.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/comctl32/tests/monthcal.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index 11a637fb82..974787ac36 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -47,6 +47,7 @@ static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
static HWND parent_wnd;
+static BOOL got_MCN_SELECT, got_MCN_SELCHANGE;
static const struct message create_parent_window_seq[] = {
{ WM_GETMINMAXINFO, sent },
@@ -544,6 +545,12 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
if(GetWindowLongPtrA(nmchg->nmhdr.hwndFrom, GWLP_ID) != SEL_NOTIFY_TEST_ID)
break;
+
+ if (hdr->code == MCN_SELECT)
+ got_MCN_SELECT = TRUE;
+ else
+ got_MCN_SELCHANGE = TRUE;
+
SendMessageA(nmchg->nmhdr.hwndFrom, is_multisel ? MCM_GETSELRANGE : MCM_GETCURSEL,
0, (LPARAM)st);
@@ -2032,8 +2039,21 @@ static void test_sel_notify(void)
mchit.pt.y++;
SendMessageA(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit);
}
+ got_MCN_SELECT = got_MCN_SELCHANGE = FALSE;
SendMessageA(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y));
+ if (styles[i].val & MCS_MULTISELECT)
+todo_wine
+ ok(got_MCN_SELCHANGE, "%d: MCN_SELCHANGE should be sent\n", i);
+ else
+ ok(!got_MCN_SELCHANGE, "%d: MCN_SELCHANGE should not be sent\n", i);
+ ok(!got_MCN_SELECT, "%d: MCN_SELECT should not be sent\n", i);
+ got_MCN_SELECT = got_MCN_SELCHANGE = FALSE;
SendMessageA(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(mchit.pt.x, mchit.pt.y));
+ if (styles[i].val & MCS_MULTISELECT)
+ ok(!got_MCN_SELCHANGE, "%d: MCN_SELCHANGE should not be sent\n", i);
+ else
+ ok(got_MCN_SELCHANGE, "%d: MCN_SELCHANGE should be sent\n", i);
+ ok(got_MCN_SELECT, "%d: MCN_SELECT should be sent\n", i);
DestroyWindow(hwnd);
}
}
More information about the wine-cvs
mailing list