Huw Davies : user32/tests: Fix tests on Windows 8.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 20 10:04:11 CDT 2015


Module: wine
Branch: master
Commit: b3fe7f7c1bb8a11e2b4b157c1af9a9a7c536ecfe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b3fe7f7c1bb8a11e2b4b157c1af9a9a7c536ecfe

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May 19 16:15:13 2015 +0100

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 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();




More information about the wine-cvs mailing list