Paul Vriens : user32/tests: Fix test failures on Win9x/WinME.

Alexandre Julliard julliard at winehq.org
Wed May 13 10:19:45 CDT 2009


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed May 13 15:13:02 2009 +0200

user32/tests: Fix test failures on Win9x/WinME.

---

 dlls/user32/tests/scroll.c |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c
index 55fb6f6..03725b9 100644
--- a/dlls/user32/tests/scroll.c
+++ b/dlls/user32/tests/scroll.c
@@ -222,25 +222,27 @@ static void scrollbar_test_default( DWORD style)
 
     ret = GetScrollRange( hwnd, SB_VERT, &min, &max);
     ok( ret ||
-            broken( !ret) /* Win 98/ME */ , "GetScrollRange failed.\n");
+            broken( !ret) /* Win 9x/ME */ , "GetScrollRange failed.\n");
     /* range is 0,0 if there are no H or V scroll bars. 0,100 otherwise */
     if( !( style & ( WS_VSCROLL | WS_HSCROLL)))
         ok( min == 0 && max == 0,
                 "Scroll bar range is %d,%d. Expected 0,0. Style %08x\n", min, max, style);
     else
 todo_wine
-        ok( min == 0 && max == 100,
+        ok(( min == 0 && max == 100) ||
+                broken( min == 0 && max == 0), /* Win 9x/ME */
                 "Scroll bar range is %d,%d. Expected 0,100. Style %08x\n", min, max, style);
     ret = GetScrollRange( hwnd, SB_HORZ, &min, &max);
     ok( ret ||
-            broken( !ret) /* Win 98/ME */ , "GetScrollRange failed.\n");
+            broken( !ret) /* Win 9x/ME */ , "GetScrollRange failed.\n");
     /* range is 0,0 if there are no H or V scroll bars. 0,100 otherwise */
     if( !( style & ( WS_VSCROLL | WS_HSCROLL)))
         ok( min == 0 && max == 0,
                 "Scroll bar range is %d,%d. Expected 0,0. Style %08x\n", min, max, style);
     else
 todo_wine
-        ok( min == 0 && max == 100,
+        ok(( min == 0 && max == 100) ||
+                broken( min == 0 && max == 0), /* Win 9x/ME */
                 "Scroll bar range is %d,%d. Expected 0,100. Style %08x\n", min, max, style);
     /* test GetScrollInfo, vist for vertical SB */
     ret = GetScrollInfo( hwnd, SB_VERT, &si);
@@ -249,7 +251,9 @@ todo_wine
         ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08x\n", style);
     else
 todo_wine
-        ok( ret, "GetScrollInfo failed unexpectedly. Style is %08x\n", style);
+        ok( ret ||
+                broken( !ret), /* Win 9x/ME */
+                "GetScrollInfo failed unexpectedly. Style is %08x\n", style);
     /* Same for Horizontal SB */
     ret = GetScrollInfo( hwnd, SB_HORZ, &si);
     /* should fail if no H orV scroll bar styles are present. Succeed otherwise */
@@ -257,7 +261,9 @@ todo_wine
         ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08x\n", style);
     else
 todo_wine
-        ok( ret, "GetScrollInfo failed unexpectedly. Style is %08x\n", style);
+        ok( ret ||
+                broken( !ret), /* Win 9x/ME */
+                "GetScrollInfo failed unexpectedly. Style is %08x\n", style);
     /* now set the Vertical Scroll range to something that could be the default value it
      * already has */;
     ret = SetScrollRange( hwnd, SB_VERT, 0, 100, FALSE);
@@ -276,7 +282,7 @@ todo_wine
     /* should succeed in ALL cases */
     ok( ret, "GetScrollInfo failed unexpectedly. Style is %08x\n", style);
     /* report the windows style */
-    winstyle = GetWindowLongW( hwnd, GWL_STYLE );
+    winstyle = GetWindowLongA( hwnd, GWL_STYLE );
     /* WS_VSCROLL added to the window style */
     if( !(style & WS_VSCROLL))
     {
@@ -286,7 +292,8 @@ todo_wine
                     "unexpected style change %8lx expected %8lx\n",
                     (winstyle & (WS_HSCROLL|WS_VSCROLL)), style | WS_VSCROLL);
         else
-            ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == style,
+            ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == style ||
+                    broken((winstyle & (WS_HSCROLL|WS_VSCROLL)) == (WS_HSCROLL|WS_VSCROLL)), /* Win 9x/ME */
                     "unexpected style change %8lx expected %8x\n",
                     (winstyle & (WS_HSCROLL|WS_VSCROLL)), style);
     }
@@ -314,7 +321,7 @@ todo_wine
     /* should succeed in ALL cases */
     ok( ret, "GetScrollInfo failed unexpectedly. Style is %08x\n", style);
     /* report the windows style */
-    winstyle = GetWindowLongW( hwnd, GWL_STYLE );
+    winstyle = GetWindowLongA( hwnd, GWL_STYLE );
     /* WS_HSCROLL added to the window style */
     if( !(style & WS_HSCROLL))
     {
@@ -324,7 +331,8 @@ todo_wine
                     "unexpected style change %8lx expected %8lx\n",
                     (winstyle & (WS_HSCROLL|WS_VSCROLL)), style | WS_HSCROLL);
         else
-            ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == style,
+            ok( (winstyle & (WS_HSCROLL|WS_VSCROLL)) == style ||
+                    broken((winstyle & (WS_HSCROLL|WS_VSCROLL)) == (WS_HSCROLL|WS_VSCROLL)), /* Win 9x/ME */
                     "unexpected style change %8lx expected %8x\n",
                     (winstyle & (WS_HSCROLL|WS_VSCROLL)), style);
     }
@@ -372,7 +380,7 @@ todo_wine
     /* should fail */
     ok( !ret, "GetScrollInfo succeeded unexpectedly. Style is %08x\n", style);
     /* add scroll styles */
-    winstyle = GetWindowLongW( hwnd, GWL_STYLE );
+    winstyle = GetWindowLongA( hwnd, GWL_STYLE );
     SetWindowLongW( hwnd, GWL_STYLE, winstyle | WS_VSCROLL | WS_HSCROLL);
     ret = GetScrollInfo( hwnd, SB_VERT, &si);
     /* should still fail */




More information about the wine-cvs mailing list