user32/tests: Fix tests on Windows 8.

Huw Davies huw at codeweavers.com
Tue May 19 10:15:13 CDT 2015


---
 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 e5c05db..e8b41c2 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();
-- 
1.8.0




More information about the wine-patches mailing list