Commit c4dec770 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent da32b078
...@@ -3295,8 +3295,6 @@ static void test_SetParent(void) ...@@ -3295,8 +3295,6 @@ static void test_SetParent(void)
BOOL ret; BOOL ret;
HWND desktop = GetDesktopWindow(); HWND desktop = GetDesktopWindow();
HMENU hMenu; 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; HWND parent, child1, child2, child3, child4, sibling;
parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW,
...@@ -3342,14 +3340,21 @@ static void test_SetParent(void) ...@@ -3342,14 +3340,21 @@ static void test_SetParent(void)
if (!is_win9x) /* Win9x doesn't survive this test */ if (!is_win9x) /* Win9x doesn't survive this test */
{ {
HWND ret;
ok(!SetParent(parent, child1), "SetParent should fail\n"); ok(!SetParent(parent, child1), "SetParent should fail\n");
ok(!SetParent(child2, child3), "SetParent should fail\n"); ok(!SetParent(child2, child3), "SetParent should fail\n");
ok(SetParent(child1, parent) != 0, "SetParent should not fail\n"); ok(SetParent(child1, parent) != 0, "SetParent should not fail\n");
ok(SetParent(parent, child2) != 0, "SetParent should not fail\n"); ret = SetParent(parent, child2);
ok(SetParent(parent, child3) != 0, "SetParent should not fail\n"); todo_wine ok( !ret || broken( ret != 0 ), "SetParent should fail\n");
ok(!SetParent(child2, parent), "SetParent should fail\n"); if (ret) /* nt4, win2k */
ok(SetParent(parent, child4) != 0, "SetParent should not fail\n"); {
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(parent, child4, child4, 0, 0, child4, parent);
check_parents(child1, parent, parent, parent, 0, child4, parent); check_parents(child1, parent, parent, parent, 0, child4, parent);
check_parents(child2, desktop, parent, parent, parent, child2, parent); check_parents(child2, desktop, parent, parent, parent, child2, parent);
...@@ -3357,6 +3362,21 @@ static void test_SetParent(void) ...@@ -3357,6 +3362,21 @@ static void test_SetParent(void)
check_parents(child4, desktop, child2, child2, child2, child4, parent); check_parents(child4, desktop, child2, child2, child2, child4, parent);
} }
else 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"); skip("Win9x/WinMe crash\n");
hMenu = CreateMenu(); hMenu = CreateMenu();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment