Alexandre Julliard : user32/tests: Fix a test that was incorrectly skipped on non-Win9x platforms.

Alexandre Julliard julliard at winehq.org
Tue Apr 6 11:20:07 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Apr  6 12:07:48 2010 +0200

user32/tests: Fix a test that was incorrectly skipped on non-Win9x platforms.

---

 dlls/user32/tests/win.c |   44 ++++++++++++++++++++++++++++++++------------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 96033a2..e3bebe7 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3295,8 +3295,6 @@ static void test_SetParent(void)
     BOOL ret;
     HWND desktop = GetDesktopWindow();
     HMENU hMenu;
-    /* FIXME: This detection is not correct as it also covers (all?) XP+ */
-    BOOL is_win9x = GetWindowLongPtrW(desktop, GWLP_WNDPROC) == 0;
     HWND parent, child1, child2, child3, child4, sibling;
 
     parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW,
@@ -3342,19 +3340,41 @@ static void test_SetParent(void)
 
     if (!is_win9x) /* Win9x doesn't survive this test */
     {
+        HWND ret;
+
         ok(!SetParent(parent, child1), "SetParent should fail\n");
         ok(!SetParent(child2, child3), "SetParent should fail\n");
         ok(SetParent(child1, parent) != 0, "SetParent should not fail\n");
-        ok(SetParent(parent, child2) != 0, "SetParent should not fail\n");
-        ok(SetParent(parent, child3) != 0, "SetParent should not fail\n");
-        ok(!SetParent(child2, parent), "SetParent should fail\n");
-        ok(SetParent(parent, child4) != 0, "SetParent should not fail\n");
-
-        check_parents(parent, child4, child4, 0, 0, child4, parent);
-        check_parents(child1, parent, parent, parent, 0, child4, parent);
-        check_parents(child2, desktop, parent, parent, parent, child2, parent);
-        check_parents(child3, child2, child2, child2, 0, child2, parent);
-        check_parents(child4, desktop, child2, child2, child2, child4, parent);
+        ret = SetParent(parent, child2);
+        todo_wine ok( !ret || broken( ret != 0 ), "SetParent should fail\n");
+        if (ret)  /* nt4, win2k */
+        {
+            ret = SetParent(parent, child3);
+            ok(ret != 0, "SetParent should not fail\n");
+            ret = SetParent(child2, parent);
+            ok(!ret, "SetParent should fail\n");
+            ret = SetParent(parent, child4);
+            ok(ret != 0, "SetParent should not fail\n");
+            check_parents(parent, child4, child4, 0, 0, child4, parent);
+            check_parents(child1, parent, parent, parent, 0, child4, parent);
+            check_parents(child2, desktop, parent, parent, parent, child2, parent);
+            check_parents(child3, child2, child2, child2, 0, child2, parent);
+            check_parents(child4, desktop, child2, child2, child2, child4, parent);
+        }
+        else
+        {
+            ret = SetParent(parent, child3);
+            ok(ret != 0, "SetParent should not fail\n");
+            ret = SetParent(child2, parent);
+            ok(!ret, "SetParent should fail\n");
+            ret = SetParent(parent, child4);
+            ok(!ret, "SetParent should fail\n");
+            check_parents(parent, child3, child3, 0, 0, child2, parent);
+            check_parents(child1, parent, parent, parent, 0, child2, parent);
+            check_parents(child2, desktop, parent, parent, parent, child2, parent);
+            check_parents(child3, child2, child2, child2, 0, child2, parent);
+            check_parents(child4, desktop, child2, child2, child2, child4, parent);
+        }
     }
     else
         skip("Win9x/WinMe crash\n");




More information about the wine-cvs mailing list