Commit ce0b7342 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

user32/tests: Use WineTest contexts to simplify test_mdi().

This also fixes the many ok() calls that were missing context information. Signed-off-by: 's avatarFrancois Gouget <fgouget@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 151ae36a
...@@ -2145,6 +2145,7 @@ static void test_mdi(void) ...@@ -2145,6 +2145,7 @@ static void test_mdi(void)
SCROLLINFO si; SCROLLINFO si;
BOOL ret, gotit; BOOL ret, gotit;
winetest_push_context("style %#x", style[i]);
mdi_client = CreateWindowExA(0, "mdiclient", NULL, mdi_client = CreateWindowExA(0, "mdiclient", NULL,
WS_CHILD | style[i], WS_CHILD | style[i],
0, 0, rc.right, rc.bottom, 0, 0, rc.right, rc.bottom,
...@@ -2183,7 +2184,7 @@ static void test_mdi(void) ...@@ -2183,7 +2184,7 @@ static void test_mdi(void)
ret = GetScrollInfo(mdi_client, SB_HORZ, &si); ret = GetScrollInfo(mdi_client, SB_HORZ, &si);
if (style[i] & (WS_HSCROLL | WS_VSCROLL)) if (style[i] & (WS_HSCROLL | WS_VSCROLL))
{ {
ok(ret, "style %#x: GetScrollInfo(SB_HORZ) failed\n", style[i]); ok(ret, "GetScrollInfo(SB_HORZ) failed\n");
ok(si.nPage == 0, "expected 0\n"); ok(si.nPage == 0, "expected 0\n");
ok(si.nPos == 0, "expected 0\n"); ok(si.nPos == 0, "expected 0\n");
ok(si.nTrackPos == 0, "expected 0\n"); ok(si.nTrackPos == 0, "expected 0\n");
...@@ -2191,12 +2192,12 @@ static void test_mdi(void) ...@@ -2191,12 +2192,12 @@ static void test_mdi(void)
ok(si.nMax == 100, "expected 100\n"); ok(si.nMax == 100, "expected 100\n");
} }
else else
ok(!ret, "style %#x: GetScrollInfo(SB_HORZ) should fail\n", style[i]); ok(!ret, "GetScrollInfo(SB_HORZ) should fail\n");
ret = GetScrollInfo(mdi_client, SB_VERT, &si); ret = GetScrollInfo(mdi_client, SB_VERT, &si);
if (style[i] & (WS_HSCROLL | WS_VSCROLL)) if (style[i] & (WS_HSCROLL | WS_VSCROLL))
{ {
ok(ret, "style %#x: GetScrollInfo(SB_VERT) failed\n", style[i]); ok(ret, "GetScrollInfo(SB_VERT) failed\n");
ok(si.nPage == 0, "expected 0\n"); ok(si.nPage == 0, "expected 0\n");
ok(si.nPos == 0, "expected 0\n"); ok(si.nPos == 0, "expected 0\n");
ok(si.nTrackPos == 0, "expected 0\n"); ok(si.nTrackPos == 0, "expected 0\n");
...@@ -2204,7 +2205,7 @@ static void test_mdi(void) ...@@ -2204,7 +2205,7 @@ static void test_mdi(void)
ok(si.nMax == 100, "expected 100\n"); ok(si.nMax == 100, "expected 100\n");
} }
else else
ok(!ret, "style %#x: GetScrollInfo(SB_VERT) should fail\n", style[i]); ok(!ret, "GetScrollInfo(SB_VERT) should fail\n");
SetWindowPos(mdi_child, 0, -100, -100, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); SetWindowPos(mdi_child, 0, -100, -100, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
...@@ -2213,7 +2214,7 @@ static void test_mdi(void) ...@@ -2213,7 +2214,7 @@ static void test_mdi(void)
ret = GetScrollInfo(mdi_client, SB_HORZ, &si); ret = GetScrollInfo(mdi_client, SB_HORZ, &si);
if (style[i] & (WS_HSCROLL | WS_VSCROLL)) if (style[i] & (WS_HSCROLL | WS_VSCROLL))
{ {
ok(ret, "style %#x: GetScrollInfo(SB_HORZ) failed\n", style[i]); ok(ret, "GetScrollInfo(SB_HORZ) failed\n");
ok(si.nPage == 0, "expected 0\n"); ok(si.nPage == 0, "expected 0\n");
ok(si.nPos == 0, "expected 0\n"); ok(si.nPos == 0, "expected 0\n");
ok(si.nTrackPos == 0, "expected 0\n"); ok(si.nTrackPos == 0, "expected 0\n");
...@@ -2221,12 +2222,12 @@ static void test_mdi(void) ...@@ -2221,12 +2222,12 @@ static void test_mdi(void)
ok(si.nMax == 100, "expected 100\n"); ok(si.nMax == 100, "expected 100\n");
} }
else else
ok(!ret, "style %#x: GetScrollInfo(SB_HORZ) should fail\n", style[i]); ok(!ret, "GetScrollInfo(SB_HORZ) should fail\n");
ret = GetScrollInfo(mdi_client, SB_VERT, &si); ret = GetScrollInfo(mdi_client, SB_VERT, &si);
if (style[i] & (WS_HSCROLL | WS_VSCROLL)) if (style[i] & (WS_HSCROLL | WS_VSCROLL))
{ {
ok(ret, "style %#x: GetScrollInfo(SB_VERT) failed\n", style[i]); ok(ret, "GetScrollInfo(SB_VERT) failed\n");
ok(si.nPage == 0, "expected 0\n"); ok(si.nPage == 0, "expected 0\n");
ok(si.nPos == 0, "expected 0\n"); ok(si.nPos == 0, "expected 0\n");
ok(si.nTrackPos == 0, "expected 0\n"); ok(si.nTrackPos == 0, "expected 0\n");
...@@ -2234,7 +2235,7 @@ static void test_mdi(void) ...@@ -2234,7 +2235,7 @@ static void test_mdi(void)
ok(si.nMax == 100, "expected 100\n"); ok(si.nMax == 100, "expected 100\n");
} }
else else
ok(!ret, "style %#x: GetScrollInfo(SB_VERT) should fail\n", style[i]); ok(!ret, "GetScrollInfo(SB_VERT) should fail\n");
gotit = FALSE; gotit = FALSE;
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
...@@ -2261,7 +2262,7 @@ static void test_mdi(void) ...@@ -2261,7 +2262,7 @@ static void test_mdi(void)
ret = GetScrollInfo(mdi_client, SB_HORZ, &si); ret = GetScrollInfo(mdi_client, SB_HORZ, &si);
if (style[i] & (WS_HSCROLL | WS_VSCROLL)) if (style[i] & (WS_HSCROLL | WS_VSCROLL))
{ {
ok(ret, "style %#x: GetScrollInfo(SB_HORZ) failed\n", style[i]); ok(ret, "GetScrollInfo(SB_HORZ) failed\n");
todo_wine todo_wine
ok(si.nPage != 0, "expected !0\n"); ok(si.nPage != 0, "expected !0\n");
ok(si.nPos == 0, "expected 0\n"); ok(si.nPos == 0, "expected 0\n");
...@@ -2270,12 +2271,12 @@ todo_wine ...@@ -2270,12 +2271,12 @@ todo_wine
ok(si.nMax != 100, "expected !100\n"); ok(si.nMax != 100, "expected !100\n");
} }
else else
ok(!ret, "style %#x: GetScrollInfo(SB_HORZ) should fail\n", style[i]); ok(!ret, "GetScrollInfo(SB_HORZ) should fail\n");
ret = GetScrollInfo(mdi_client, SB_VERT, &si); ret = GetScrollInfo(mdi_client, SB_VERT, &si);
if (style[i] & (WS_HSCROLL | WS_VSCROLL)) if (style[i] & (WS_HSCROLL | WS_VSCROLL))
{ {
ok(ret, "style %#x: GetScrollInfo(SB_VERT) failed\n", style[i]); ok(ret, "GetScrollInfo(SB_VERT) failed\n");
todo_wine todo_wine
ok(si.nPage != 0, "expected !0\n"); ok(si.nPage != 0, "expected !0\n");
ok(si.nPos == 0, "expected 0\n"); ok(si.nPos == 0, "expected 0\n");
...@@ -2284,11 +2285,12 @@ todo_wine ...@@ -2284,11 +2285,12 @@ todo_wine
ok(si.nMax != 100, "expected !100\n"); ok(si.nMax != 100, "expected !100\n");
} }
else else
ok(!ret, "style %#x: GetScrollInfo(SB_VERT) should fail\n", style[i]); ok(!ret, "GetScrollInfo(SB_VERT) should fail\n");
DestroyMenu(child_menu); DestroyMenu(child_menu);
DestroyWindow(mdi_child); DestroyWindow(mdi_child);
DestroyWindow(mdi_client); DestroyWindow(mdi_client);
winetest_pop_context();
} }
SetMenu(mdi_hwndMain, frame_menu); SetMenu(mdi_hwndMain, frame_menu);
......
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