From b3fe7f7c1bb8a11e2b4b157c1af9a9a7c536ecfe Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 19 May 2015 16:15:13 +0100 Subject: [PATCH] user32/tests: Fix tests on Windows 8. --- dlls/user32/tests/edit.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index e5c05db574b..e8b41c2822a 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -841,12 +841,14 @@ static void zero_notify(void) } #define test_notify(enchange, enmaxtext, enupdate) \ +do { \ ok(notifications.en_change == enchange, "expected %d EN_CHANGE notifications, " \ "got %d\n", enchange, notifications.en_change); \ ok(notifications.en_maxtext == enmaxtext, "expected %d EN_MAXTEXT notifications, " \ "got %d\n", enmaxtext, notifications.en_maxtext); \ ok(notifications.en_update == enupdate, "expected %d EN_UPDATE notifications, " \ - "got %d\n", enupdate, notifications.en_update) + "got %d\n", enupdate, notifications.en_update); \ +} while(0) static LRESULT CALLBACK edit3_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -907,8 +909,10 @@ static void test_edit_control_3(void) zero_notify(); SendMessageA(hWnd, EM_REPLACESEL, 0, (LPARAM)str); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); - ok(lstrlenA(str) > len, "text should have been truncated\n"); - test_notify(1, 1, 1); + if (len == lstrlenA(str)) /* Win 8 */ + test_notify(1, 0, 1); + else + test_notify(1, 1, 1); SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)""); zero_notify(); @@ -998,8 +1002,13 @@ static void test_edit_control_3(void) zero_notify(); SendMessageA(hWnd, EM_REPLACESEL, 0, (LPARAM)str); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); - ok(0 == len, "text should have been truncated, expected 0, got %d\n", len); - test_notify(1, 1, 1); + if (len == lstrlenA(str)) /* Win 8 */ + test_notify(1, 0, 1); + else + { + ok(0 == len, "text should have been truncated, expected 0, got %d\n", len); + test_notify(1, 1, 1); + } SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)""); zero_notify();