Commit 7f5adb69 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

user32/tests: Use wine_dbgstr_rect() to print RECTs.

parent 82fa7dea
...@@ -1284,8 +1284,7 @@ static void test_edit_control_5(void) ...@@ -1284,8 +1284,7 @@ static void test_edit_control_5(void)
assert(hWnd); assert(hWnd);
GetClientRect( hWnd, &rc); GetClientRect( hWnd, &rc);
ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top, ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top,
"Client rectangle not the expected size (%d,%d,%d,%d)\n", "Client rectangle not the expected size %s\n", wine_dbgstr_rect( &rc ));
rc.left, rc.top, rc.right, rc.bottom);
len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
DestroyWindow(hWnd); DestroyWindow(hWnd);
...@@ -1299,8 +1298,7 @@ static void test_edit_control_5(void) ...@@ -1299,8 +1298,7 @@ static void test_edit_control_5(void)
assert(hWnd); assert(hWnd);
GetClientRect( hWnd, &rc); GetClientRect( hWnd, &rc);
ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top, ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top,
"Client rectangle not the expected size (%d,%d,%d,%d)\n", "Client rectangle not the expected size %s\n", wine_dbgstr_rect( &rc ));
rc.left, rc.top, rc.right, rc.bottom);
len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
DestroyWindow(hWnd); DestroyWindow(hWnd);
...@@ -1502,7 +1500,7 @@ static void test_margins(void) ...@@ -1502,7 +1500,7 @@ static void test_margins(void)
hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
ok(hwEdit != NULL, "got %p\n", hwEdit); ok(hwEdit != NULL, "got %p\n", hwEdit);
GetClientRect(hwEdit, &old_rect); GetClientRect(hwEdit, &old_rect);
ok(IsRectEmpty(&old_rect), "got rect %d,%d-%d,%d\n", old_rect.left, old_rect.top, old_rect.right, old_rect.bottom); ok(IsRectEmpty(&old_rect), "got rect %s\n", wine_dbgstr_rect(&old_rect));
old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(old_margins == 0, "got %x\n", old_margins); ok(old_margins == 0, "got %x\n", old_margins);
...@@ -1517,7 +1515,7 @@ static void test_margins(void) ...@@ -1517,7 +1515,7 @@ static void test_margins(void)
hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 2, 2, NULL, NULL, NULL, NULL); hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 2, 2, NULL, NULL, NULL, NULL);
ok(hwEdit != NULL, "got %p\n", hwEdit); ok(hwEdit != NULL, "got %p\n", hwEdit);
GetClientRect(hwEdit, &old_rect); GetClientRect(hwEdit, &old_rect);
ok(!IsRectEmpty(&old_rect), "got rect %d,%d-%d,%d\n", old_rect.left, old_rect.top, old_rect.right, old_rect.bottom); ok(!IsRectEmpty(&old_rect), "got rect %s\n", wine_dbgstr_rect(&old_rect));
old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0);
ok(old_margins == 0, "got %x\n", old_margins); ok(old_margins == 0, "got %x\n", old_margins);
......
...@@ -251,18 +251,16 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA ...@@ -251,18 +251,16 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
ok(dis->CtlType == ODT_LISTBOX, "wrong CtlType %04x\n", dis->CtlType); ok(dis->CtlType == ODT_LISTBOX, "wrong CtlType %04x\n", dis->CtlType);
GetClientRect(dis->hwndItem, &rc_client); GetClientRect(dis->hwndItem, &rc_client);
trace("hwndItem %p client rect (%d,%d-%d,%d)\n", dis->hwndItem, trace("hwndItem %p client rect %s\n", dis->hwndItem, wine_dbgstr_rect(&rc_client));
rc_client.left, rc_client.top, rc_client.right, rc_client.bottom);
GetClipBox(dis->hDC, &rc_clip); GetClipBox(dis->hDC, &rc_clip);
trace("clip rect (%d,%d-%d,%d)\n", rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom); trace("clip rect %s\n", wine_dbgstr_rect(&rc_clip));
ok(EqualRect(&rc_client, &rc_clip) || IsRectEmpty(&rc_clip), ok(EqualRect(&rc_client, &rc_clip) || IsRectEmpty(&rc_clip),
"client rect of the listbox should be equal to the clip box," "client rect of the listbox should be equal to the clip box,"
"or the clip box should be empty\n"); "or the clip box should be empty\n");
trace("rcItem (%d,%d-%d,%d)\n", dis->rcItem.left, dis->rcItem.top, trace("rcItem %s\n", wine_dbgstr_rect(&dis->rcItem));
dis->rcItem.right, dis->rcItem.bottom);
SendMessageA(dis->hwndItem, LB_GETITEMRECT, dis->itemID, (LPARAM)&rc_item); SendMessageA(dis->hwndItem, LB_GETITEMRECT, dis->itemID, (LPARAM)&rc_item);
trace("item rect (%d,%d-%d,%d)\n", rc_item.left, rc_item.top, rc_item.right, rc_item.bottom); trace("item rect %s\n", wine_dbgstr_rect(&rc_item));
ok(EqualRect(&dis->rcItem, &rc_item), "item rects are not equal\n"); ok(EqualRect(&dis->rcItem, &rc_item), "item rects are not equal\n");
break; break;
...@@ -334,7 +332,7 @@ static void test_ownerdraw(void) ...@@ -334,7 +332,7 @@ static void test_ownerdraw(void)
ok(ret == 1, "wrong top index %d\n", ret); ok(ret == 1, "wrong top index %d\n", ret);
SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc); SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc);
trace("item 0 rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); trace("item 0 rect %s\n", wine_dbgstr_rect(&rc));
ok(!IsRectEmpty(&rc), "empty item rect\n"); ok(!IsRectEmpty(&rc), "empty item rect\n");
ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top); ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top);
......
...@@ -194,11 +194,9 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, ...@@ -194,11 +194,9 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
if (winetest_debug > 1) { if (winetest_debug > 1) {
RECT rc; RECT rc;
GetMenuItemRect( hwnd, (HMENU)pdis->hwndItem, pdis->itemData ,&rc); GetMenuItemRect( hwnd, (HMENU)pdis->hwndItem, pdis->itemData ,&rc);
trace("WM_DRAWITEM received hwnd %p hmenu %p itemdata %ld item %d rc %d,%d-%d,%d itemrc: %d,%d-%d,%d\n", trace("WM_DRAWITEM received hwnd %p hmenu %p itemdata %ld item %d rc %s itemrc: %s\n",
hwnd, pdis->hwndItem, pdis->itemData, pdis->itemID, hwnd, pdis->hwndItem, pdis->itemData, pdis->itemID,
pdis->rcItem.left, pdis->rcItem.top, wine_dbgstr_rect(&pdis->rcItem), wine_dbgstr_rect(&rc));
pdis->rcItem.right,pdis->rcItem.bottom,
rc.left,rc.top,rc.right,rc.bottom);
oldpen=SelectObject( pdis->hDC, GetStockObject( oldpen=SelectObject( pdis->hDC, GetStockObject(
pdis->itemState & ODS_SELECTED ? WHITE_PEN :BLACK_PEN)); pdis->itemState & ODS_SELECTED ? WHITE_PEN :BLACK_PEN));
Rectangle( pdis->hDC, pdis->rcItem.left,pdis->rcItem.top, Rectangle( pdis->hDC, pdis->rcItem.left,pdis->rcItem.top,
...@@ -347,10 +345,8 @@ static void test_getmenubarinfo(void) ...@@ -347,10 +345,8 @@ static void test_getmenubarinfo(void)
ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi); ret = pGetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError()); ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
ok(mbi.rcBar.left == 0 && mbi.rcBar.top == 0 && ok(mbi.rcBar.left == 0 && mbi.rcBar.top == 0 && mbi.rcBar.bottom == 0 && mbi.rcBar.right == 0,
mbi.rcBar.bottom == 0 && mbi.rcBar.right == 0, "rcBar: Expected (0,0)-(0,0), got: %s\n", wine_dbgstr_rect(&mbi.rcBar));
"rcBar: Expected 0,0-0,0, got: %d,%d-%d,%d\n",
mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom);
ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n",
mbi.hMenu, hmenu); mbi.hMenu, hmenu);
ok(mbi.fBarFocused == 0, "fBarFocused: Got %d instead of 0.\n", mbi.fBarFocused); ok(mbi.fBarFocused == 0, "fBarFocused: Got %d instead of 0.\n", mbi.fBarFocused);
...@@ -381,8 +377,7 @@ static void test_getmenubarinfo(void) ...@@ -381,8 +377,7 @@ static void test_getmenubarinfo(void)
ok(ret, "GetMenuItemRect failed.\n"); ok(ret, "GetMenuItemRect failed.\n");
todo_wine ok(mbi.rcBar.left == rci.left && mbi.rcBar.top == rci.top && todo_wine ok(mbi.rcBar.left == rci.left && mbi.rcBar.top == rci.top &&
mbi.rcBar.bottom == rci.bottom && mbi.rcBar.right == rcw.right - rci.left + rcw.left, mbi.rcBar.bottom == rci.bottom && mbi.rcBar.right == rcw.right - rci.left + rcw.left,
"rcBar: Got %d,%d-%d,%d instead of %d,%d-%d,%d\n", "rcBar: Got %s instead of (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&mbi.rcBar),
mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom,
rci.left, rci.top, rcw.right - rci.left + rcw.left, rci.bottom); rci.left, rci.top, rcw.right - rci.left + rcw.left, rci.bottom);
ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu); ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu);
ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n", mbi.fBarFocused); ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n", mbi.fBarFocused);
...@@ -393,9 +388,8 @@ static void test_getmenubarinfo(void) ...@@ -393,9 +388,8 @@ static void test_getmenubarinfo(void)
ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError()); ok(ret, "GetMenuBarInfo failed with error %d\n", GetLastError());
ret = GetMenuItemRect(hwnd, hmenu, 1, &rci); ret = GetMenuItemRect(hwnd, hmenu, 1, &rci);
ok(ret, "GetMenuItemRect failed.\n"); ok(ret, "GetMenuItemRect failed.\n");
ok(EqualRect(&mbi.rcBar, &rci), "rcBar: Got %d,%d-%d,%d instead of %d,%d-%d,%d\n", ok(EqualRect(&mbi.rcBar, &rci), "rcBar: Got %s instead of %s\n", wine_dbgstr_rect(&mbi.rcBar),
mbi.rcBar.left, mbi.rcBar.top, mbi.rcBar.right, mbi.rcBar.bottom, wine_dbgstr_rect(&rci));
rci.left, rci.top, rci.right, rci.bottom);
ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu); ok(mbi.hMenu == hmenu, "hMenu: Got %p instead of %p\n", mbi.hMenu, hmenu);
ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n", mbi.fBarFocused); ok(mbi.fBarFocused == 0, "fBarFocused: got %d instead of 0\n", mbi.fBarFocused);
ok(mbi.fFocused == 0, "fFocused: got %d instead of 0\n", mbi.fFocused); ok(mbi.fFocused == 0, "fFocused: got %d instead of 0\n", mbi.fFocused);
...@@ -975,9 +969,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt, ...@@ -975,9 +969,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
GetSystemMetrics(SM_CXMENUCHECK ), GetSystemMetrics(SM_CXMENUCHECK ),
GetSystemMetrics(SM_CYMENUCHECK ),arrowwidth, MOD_avec); GetSystemMetrics(SM_CYMENUCHECK ),arrowwidth, MOD_avec);
if( hbmp == HBMMENU_CALLBACK) if( hbmp == HBMMENU_CALLBACK)
trace( " rc %d,%d-%d,%d bmp.rc %d,%d-%d,%d\n", trace( " rc %s bmp.rc %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(&MOD_rc[0]));
rc.left, rc.top, rc.top, rc.bottom, MOD_rc[0].left,
MOD_rc[0].top,MOD_rc[0].right, MOD_rc[0].bottom);
} }
/* clean up */ /* clean up */
ret = DestroyMenu(submenu); ret = DestroyMenu(submenu);
......
...@@ -262,21 +262,21 @@ static void test_ChangeDisplaySettingsEx(void) ...@@ -262,21 +262,21 @@ static void test_ChangeDisplaySettingsEx(void)
/* Resolution change resets clip rect */ /* Resolution change resets clip rect */
ok(GetClipCursor(&r), "GetClipCursor() failed\n"); ok(GetClipCursor(&r), "GetClipCursor() failed\n");
ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom); ok(EqualRect(&r, &virt), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
if (!ClipCursor(NULL)) continue; if (!ClipCursor(NULL)) continue;
ok(GetClipCursor(&r), "GetClipCursor() failed\n"); ok(GetClipCursor(&r), "GetClipCursor() failed\n");
ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom); ok(EqualRect(&r, &virt), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
/* This should always work. Primary monitor is at (0,0) */ /* This should always work. Primary monitor is at (0,0) */
SetRect(&r1, 10, 10, 20, 20); SetRect(&r1, 10, 10, 20, 20);
ok(ClipCursor(&r1), "ClipCursor() failed\n"); ok(ClipCursor(&r1), "ClipCursor() failed\n");
ok(GetClipCursor(&r), "GetClipCursor() failed\n"); ok(GetClipCursor(&r), "GetClipCursor() failed\n");
ok(EqualRect(&r, &r1), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom); ok(EqualRect(&r, &r1), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
SetRect(&r1, 10, 10, 10, 10); SetRect(&r1, 10, 10, 10, 10);
ok(ClipCursor(&r1), "ClipCursor() failed\n"); ok(ClipCursor(&r1), "ClipCursor() failed\n");
ok(GetClipCursor(&r), "GetClipCursor() failed\n"); ok(GetClipCursor(&r), "GetClipCursor() failed\n");
ok(EqualRect(&r, &r1), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom); ok(EqualRect(&r, &r1), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
SetRect(&r1, 10, 10, 10, 9); SetRect(&r1, 10, 10, 10, 9);
ok(!ClipCursor(&r1), "ClipCursor() succeeded\n"); ok(!ClipCursor(&r1), "ClipCursor() succeeded\n");
/* Windows bug: further clipping fails once an empty rect is set, so we have to reset it */ /* Windows bug: further clipping fails once an empty rect is set, so we have to reset it */
...@@ -285,9 +285,8 @@ static void test_ChangeDisplaySettingsEx(void) ...@@ -285,9 +285,8 @@ static void test_ChangeDisplaySettingsEx(void)
SetRect(&r1, virt.left - 10, virt.top - 10, virt.right + 20, virt.bottom + 20); SetRect(&r1, virt.left - 10, virt.top - 10, virt.right + 20, virt.bottom + 20);
ok(ClipCursor(&r1), "ClipCursor() failed\n"); ok(ClipCursor(&r1), "ClipCursor() failed\n");
ok(GetClipCursor(&r), "GetClipCursor() failed\n"); ok(GetClipCursor(&r), "GetClipCursor() failed\n");
ok(EqualRect(&r, &virt) || ok(EqualRect(&r, &virt) || broken(EqualRect(&r, &r1)) /* win9x */,
broken(EqualRect(&r, &r1)) /* win9x */, "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
"Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom);
ClipCursor(&virt); ClipCursor(&virt);
} }
} }
...@@ -499,13 +498,12 @@ static void test_work_area(void) ...@@ -499,13 +498,12 @@ static void test_work_area(void)
ret = pGetMonitorInfoA(hmon, &mi); ret = pGetMonitorInfoA(hmon, &mi);
ok(ret, "GetMonitorInfo error %u\n", GetLastError()); ok(ret, "GetMonitorInfo error %u\n", GetLastError());
ok(mi.dwFlags & MONITORINFOF_PRIMARY, "not a primary monitor\n"); ok(mi.dwFlags & MONITORINFOF_PRIMARY, "not a primary monitor\n");
trace("primary monitor (%d,%d-%d,%d)\n", trace("primary monitor %s\n", wine_dbgstr_rect(&mi.rcMonitor));
mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SystemParametersInfoA(SPI_GETWORKAREA, 0, &rc_work, 0); ret = SystemParametersInfoA(SPI_GETWORKAREA, 0, &rc_work, 0);
ok(ret, "SystemParametersInfo error %u\n", GetLastError()); ok(ret, "SystemParametersInfo error %u\n", GetLastError());
trace("work area (%d,%d-%d,%d)\n", rc_work.left, rc_work.top, rc_work.right, rc_work.bottom); trace("work area %s\n", wine_dbgstr_rect(&rc_work));
ok(EqualRect(&rc_work, &mi.rcWork), "work area is different\n"); ok(EqualRect(&rc_work, &mi.rcWork), "work area is different\n");
hwnd = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL); hwnd = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL);
...@@ -513,16 +511,13 @@ static void test_work_area(void) ...@@ -513,16 +511,13 @@ static void test_work_area(void)
ret = GetWindowRect(hwnd, &rc_normal); ret = GetWindowRect(hwnd, &rc_normal);
ok(ret, "GetWindowRect failed\n"); ok(ret, "GetWindowRect failed\n");
trace("normal (%d,%d-%d,%d)\n", rc_normal.left, rc_normal.top, rc_normal.right, rc_normal.bottom); trace("normal %s\n", wine_dbgstr_rect(&rc_normal));
wp.length = sizeof(wp); wp.length = sizeof(wp);
ret = GetWindowPlacement(hwnd, &wp); ret = GetWindowPlacement(hwnd, &wp);
ok(ret, "GetWindowPlacement failed\n"); ok(ret, "GetWindowPlacement failed\n");
trace("min: %d,%d max %d,%d normal %d,%d-%d,%d\n", trace("min: %d,%d max %d,%d normal %s\n", wp.ptMinPosition.x, wp.ptMinPosition.y,
wp.ptMinPosition.x, wp.ptMinPosition.y, wp.ptMaxPosition.x, wp.ptMaxPosition.y, wine_dbgstr_rect(&wp.rcNormalPosition));
wp.ptMaxPosition.x, wp.ptMaxPosition.y,
wp.rcNormalPosition.left, wp.rcNormalPosition.top,
wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
OffsetRect(&wp.rcNormalPosition, rc_work.left, rc_work.top); OffsetRect(&wp.rcNormalPosition, rc_work.left, rc_work.top);
todo_wine_if (mi.rcMonitor.left != mi.rcWork.left || todo_wine_if (mi.rcMonitor.left != mi.rcWork.left ||
mi.rcMonitor.top != mi.rcWork.top) /* FIXME: remove once Wine is fixed */ mi.rcMonitor.top != mi.rcWork.top) /* FIXME: remove once Wine is fixed */
...@@ -535,11 +530,8 @@ static void test_work_area(void) ...@@ -535,11 +530,8 @@ static void test_work_area(void)
wp.length = sizeof(wp); wp.length = sizeof(wp);
ret = GetWindowPlacement(hwnd, &wp); ret = GetWindowPlacement(hwnd, &wp);
ok(ret, "GetWindowPlacement failed\n"); ok(ret, "GetWindowPlacement failed\n");
trace("min: %d,%d max %d,%d normal %d,%d-%d,%d\n", trace("min: %d,%d max %d,%d normal %s\n", wp.ptMinPosition.x, wp.ptMinPosition.y,
wp.ptMinPosition.x, wp.ptMinPosition.y, wp.ptMaxPosition.x, wp.ptMaxPosition.y, wine_dbgstr_rect(&wp.rcNormalPosition));
wp.ptMaxPosition.x, wp.ptMaxPosition.y,
wp.rcNormalPosition.left, wp.rcNormalPosition.top,
wp.rcNormalPosition.right, wp.rcNormalPosition.bottom);
ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n"); ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
DestroyWindow(hwnd); DestroyWindow(hwnd);
......
...@@ -4354,8 +4354,7 @@ static void test_showwindow(void) ...@@ -4354,8 +4354,7 @@ static void test_showwindow(void)
GetWindowRect(hwnd, &rc); GetWindowRect(hwnd, &rc);
ok( rc.right-rc.left == GetSystemMetrics(SM_CXSCREEN) && ok( rc.right-rc.left == GetSystemMetrics(SM_CXSCREEN) &&
rc.bottom-rc.top == GetSystemMetrics(SM_CYSCREEN), rc.bottom-rc.top == GetSystemMetrics(SM_CYSCREEN),
"Invalid maximized size before ShowWindow (%d,%d)-(%d,%d)\n", "Invalid maximized size before ShowWindow %s\n", wine_dbgstr_rect( &rc ));
rc.left, rc.top, rc.right, rc.bottom);
/* Reset window's size & position */ /* Reset window's size & position */
SetWindowPos(hwnd, 0, 10, 10, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE); SetWindowPos(hwnd, 0, 10, 10, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE);
ok(IsZoomed(hwnd), "window should be maximized\n"); ok(IsZoomed(hwnd), "window should be maximized\n");
...@@ -4369,8 +4368,7 @@ static void test_showwindow(void) ...@@ -4369,8 +4368,7 @@ static void test_showwindow(void)
GetWindowRect(hwnd, &rc); GetWindowRect(hwnd, &rc);
ok( rc.right-rc.left == GetSystemMetrics(SM_CXSCREEN) && ok( rc.right-rc.left == GetSystemMetrics(SM_CXSCREEN) &&
rc.bottom-rc.top == GetSystemMetrics(SM_CYSCREEN), rc.bottom-rc.top == GetSystemMetrics(SM_CYSCREEN),
"Invalid maximized size after ShowWindow (%d,%d)-(%d,%d)\n", "Invalid maximized size after ShowWindow %s\n", wine_dbgstr_rect( &rc ));
rc.left, rc.top, rc.right, rc.bottom);
DestroyWindow(hwnd); DestroyWindow(hwnd);
flush_sequence(); flush_sequence();
...@@ -6499,8 +6497,8 @@ static void check_update_rgn( HWND hwnd, HRGN hrgn ) ...@@ -6499,8 +6497,8 @@ static void check_update_rgn( HWND hwnd, HRGN hrgn )
} }
GetRgnBox( update, &r1 ); GetRgnBox( update, &r1 );
GetUpdateRect( hwnd, &r2, FALSE ); GetUpdateRect( hwnd, &r2, FALSE );
ok( EqualRect( &r1, &r2 ), "Rectangles are different: %d,%d-%d,%d / %d,%d-%d,%d\n", ok( EqualRect( &r1, &r2 ), "Rectangles are different: %s / %s\n", wine_dbgstr_rect( &r1 ),
r1.left, r1.top, r1.right, r1.bottom, r2.left, r2.top, r2.right, r2.bottom ); wine_dbgstr_rect( &r2 ));
DeleteObject( tmp ); DeleteObject( tmp );
DeleteObject( update ); DeleteObject( update );
...@@ -8288,8 +8286,7 @@ static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam ...@@ -8288,8 +8286,7 @@ static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam
RECT rc; RECT rc;
INT ret = GetClipBox((HDC)wParam, &rc); INT ret = GetClipBox((HDC)wParam, &rc);
trace("WM_ERASEBKGND: GetClipBox()=%d, (%d,%d-%d,%d)\n", trace("WM_ERASEBKGND: GetClipBox()=%d, %s\n", ret, wine_dbgstr_rect(&rc));
ret, rc.left, rc.top, rc.right, rc.bottom);
break; break;
} }
} }
...@@ -14602,10 +14599,10 @@ static void test_SetParent(void) ...@@ -14602,10 +14599,10 @@ static void test_SetParent(void)
ok(child != 0, "Failed to create child window\n"); ok(child != 0, "Failed to create child window\n");
GetWindowRect(parent1, &rc); GetWindowRect(parent1, &rc);
trace("parent1 (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); trace("parent1 %s\n", wine_dbgstr_rect(&rc));
GetWindowRect(child, &rc_old); GetWindowRect(child, &rc_old);
MapWindowPoints(0, parent1, (POINT *)&rc_old, 2); MapWindowPoints(0, parent1, (POINT *)&rc_old, 2);
trace("child (%d,%d)-(%d,%d)\n", rc_old.left, rc_old.top, rc_old.right, rc_old.bottom); trace("child %s\n", wine_dbgstr_rect(&rc_old));
flush_sequence(); flush_sequence();
...@@ -14617,14 +14614,13 @@ static void test_SetParent(void) ...@@ -14617,14 +14614,13 @@ static void test_SetParent(void)
ok(!IsWindowVisible(child), "IsWindowVisible() should return FALSE\n"); ok(!IsWindowVisible(child), "IsWindowVisible() should return FALSE\n");
GetWindowRect(parent2, &rc); GetWindowRect(parent2, &rc);
trace("parent2 (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); trace("parent2 %s\n", wine_dbgstr_rect(&rc));
GetWindowRect(child, &rc); GetWindowRect(child, &rc);
MapWindowPoints(0, parent2, (POINT *)&rc, 2); MapWindowPoints(0, parent2, (POINT *)&rc, 2);
trace("child (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); trace("child %s\n", wine_dbgstr_rect(&rc));
ok(EqualRect(&rc_old, &rc), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n", ok(EqualRect(&rc_old, &rc), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc_old),
rc_old.left, rc_old.top, rc_old.right, rc_old.bottom, wine_dbgstr_rect(&rc));
rc.left, rc.top, rc.right, rc.bottom );
/* WS_POPUP window */ /* WS_POPUP window */
popup = CreateWindowExA(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE, popup = CreateWindowExA(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE,
...@@ -14632,7 +14628,7 @@ static void test_SetParent(void) ...@@ -14632,7 +14628,7 @@ static void test_SetParent(void)
ok(popup != 0, "Failed to create popup window\n"); ok(popup != 0, "Failed to create popup window\n");
GetWindowRect(popup, &rc_old); GetWindowRect(popup, &rc_old);
trace("popup (%d,%d)-(%d,%d)\n", rc_old.left, rc_old.top, rc_old.right, rc_old.bottom); trace("popup %s\n", wine_dbgstr_rect(&rc_old));
flush_sequence(); flush_sequence();
...@@ -14644,14 +14640,13 @@ static void test_SetParent(void) ...@@ -14644,14 +14640,13 @@ static void test_SetParent(void)
ok(!IsWindowVisible(popup), "IsWindowVisible() should return FALSE\n"); ok(!IsWindowVisible(popup), "IsWindowVisible() should return FALSE\n");
GetWindowRect(child, &rc); GetWindowRect(child, &rc);
trace("parent2 (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); trace("parent2 %s\n", wine_dbgstr_rect(&rc));
GetWindowRect(popup, &rc); GetWindowRect(popup, &rc);
MapWindowPoints(0, child, (POINT *)&rc, 2); MapWindowPoints(0, child, (POINT *)&rc, 2);
trace("popup (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); trace("popup %s\n", wine_dbgstr_rect(&rc));
ok(EqualRect(&rc_old, &rc), "rects do not match (%d,%d-%d,%d) / (%d,%d-%d,%d)\n", ok(EqualRect(&rc_old, &rc), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc_old),
rc_old.left, rc_old.top, rc_old.right, rc_old.bottom, wine_dbgstr_rect(&rc));
rc.left, rc.top, rc.right, rc.bottom );
DestroyWindow(popup); DestroyWindow(popup);
DestroyWindow(child); DestroyWindow(child);
...@@ -15452,10 +15447,10 @@ static void test_layered_window(void) ...@@ -15452,10 +15447,10 @@ static void test_layered_window(void)
ok_sequence( WmEmptySeq, "UpdateLayeredWindow", FALSE ); ok_sequence( WmEmptySeq, "UpdateLayeredWindow", FALSE );
GetWindowRect( hwnd, &rect ); GetWindowRect( hwnd, &rect );
ok( rect.left == 300 && rect.top == 300 && rect.right == 550 && rect.bottom == 550, ok( rect.left == 300 && rect.top == 300 && rect.right == 550 && rect.bottom == 550,
"wrong window rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
ok( rect.right == client.right - 50 && rect.bottom == client.bottom - 50, ok( rect.right == client.right - 50 && rect.bottom == client.bottom - 50,
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
size.cx = 150; size.cx = 150;
pos.y = 200; pos.y = 200;
...@@ -15464,10 +15459,10 @@ static void test_layered_window(void) ...@@ -15464,10 +15459,10 @@ static void test_layered_window(void)
ok_sequence( WmEmptySeq, "UpdateLayeredWindow", FALSE ); ok_sequence( WmEmptySeq, "UpdateLayeredWindow", FALSE );
GetWindowRect( hwnd, &rect ); GetWindowRect( hwnd, &rect );
ok( rect.left == 300 && rect.top == 200 && rect.right == 450 && rect.bottom == 450, ok( rect.left == 300 && rect.top == 200 && rect.right == 450 && rect.bottom == 450,
"wrong window rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
ok( rect.right == client.right - 150 && rect.bottom == client.bottom - 50, ok( rect.right == client.right - 150 && rect.bottom == client.bottom - 50,
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
SetWindowLongA( hwnd, GWL_STYLE, SetWindowLongA( hwnd, GWL_STYLE,
GetWindowLongA(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU) ); GetWindowLongA(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_THICKFRAME | WS_SYSMENU) );
...@@ -15480,11 +15475,11 @@ static void test_layered_window(void) ...@@ -15480,11 +15475,11 @@ static void test_layered_window(void)
ok_sequence( WmEmptySeq, "UpdateLayeredWindow", FALSE ); ok_sequence( WmEmptySeq, "UpdateLayeredWindow", FALSE );
GetWindowRect( hwnd, &rect ); GetWindowRect( hwnd, &rect );
ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450, ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450,
"wrong window rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
ok( (rect.right == 200 && rect.bottom == 250) || ok( (rect.right == 200 && rect.bottom == 250) ||
broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50), broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50),
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
size.cx = 0; size.cx = 0;
ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE ); ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
...@@ -15501,11 +15496,11 @@ static void test_layered_window(void) ...@@ -15501,11 +15496,11 @@ static void test_layered_window(void)
ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE ); ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE );
GetWindowRect( hwnd, &rect ); GetWindowRect( hwnd, &rect );
ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450, ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450,
"wrong window rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
ok( (rect.right == 200 && rect.bottom == 250) || ok( (rect.right == 200 && rect.bottom == 250) ||
broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50), broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50),
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
info.hwnd = hwnd; info.hwnd = hwnd;
...@@ -15521,11 +15516,11 @@ static void test_layered_window(void) ...@@ -15521,11 +15516,11 @@ static void test_layered_window(void)
CloseHandle( thread ); CloseHandle( thread );
GetWindowRect( hwnd, &rect ); GetWindowRect( hwnd, &rect );
ok( rect.left == 200 && rect.top == 200 && rect.right == 450 && rect.bottom == 500, ok( rect.left == 200 && rect.top == 200 && rect.right == 450 && rect.bottom == 500,
"wrong window rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
ok( (rect.right == 250 && rect.bottom == 300) || ok( (rect.right == 250 && rect.bottom == 300) ||
broken(rect.right == client.right - 50 && rect.bottom == client.bottom), broken(rect.right == client.right - 50 && rect.bottom == client.bottom),
"wrong client rect %d,%d,%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
DestroyWindow( hwnd ); DestroyWindow( hwnd );
DeleteDC( hdc ); DeleteDC( hdc );
......
...@@ -600,8 +600,7 @@ static void test_DrawTextCalcRect(void) ...@@ -600,8 +600,7 @@ static void test_DrawTextCalcRect(void)
ok(textheight >= heightcheck, "Got unexpected textheight %d\n", textheight); ok(textheight >= heightcheck, "Got unexpected textheight %d\n", textheight);
ok(dtp.iTabLength == 0, "invalid dtp.iTabLength = %i\n",dtp.iTabLength); ok(dtp.iTabLength == 0, "invalid dtp.iTabLength = %i\n",dtp.iTabLength);
ok(rect.left == rect2.left && rect.right != rect2.right && rect.top == rect2.top && rect.bottom == rect2.bottom, ok(rect.left == rect2.left && rect.right != rect2.right && rect.top == rect2.top && rect.bottom == rect2.bottom,
"incorrect rect %d,%d-%d,%d rect2 %d,%d-%d,%d\n", "incorrect rect %s rect2 %s\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&rect2));
rect.left, rect.top, rect.right, rect.bottom, rect2.left, rect2.top, rect2.right, rect2.bottom );
SetRect( &rect, 0,0, 10, 10); SetRect( &rect, 0,0, 10, 10);
memset(&dtp, 0, sizeof(dtp)); memset(&dtp, 0, sizeof(dtp));
......
...@@ -76,8 +76,8 @@ static void test_SubtractRect(void) ...@@ -76,8 +76,8 @@ static void test_SubtractRect(void)
result = SubtractRect(&rectr, &rect1, &rect2); result = SubtractRect(&rectr, &rect1, &rect2);
ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n");
ok(result && rectr.left == 50 && rectr.top == 50 && rectr.right ==150 ok(result && rectr.left == 50 && rectr.top == 50 && rectr.right ==150
&& rectr.bottom == 100, "wrong rect subtraction of SubtractRect " && rectr.bottom == 100, "wrong rect subtraction of SubtractRect (dest rect=%s)\n",
"(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); wine_dbgstr_rect(&rectr));
/* source rect 2 partially overlaps rect 1 */ /* source rect 2 partially overlaps rect 1 */
SetRect(&rect1, 2431, 626, 3427, 1608); SetRect(&rect1, 2431, 626, 3427, 1608);
...@@ -85,8 +85,8 @@ static void test_SubtractRect(void) ...@@ -85,8 +85,8 @@ static void test_SubtractRect(void)
result = SubtractRect(&rectr, &rect1, &rect2); result = SubtractRect(&rectr, &rect1, &rect2);
ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n");
ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499 ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499
&& rectr.bottom == 1608, "wrong rect subtraction of SubtractRect " && rectr.bottom == 1608, "wrong rect subtraction of SubtractRect (dest rect=%s)\n",
"(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); wine_dbgstr_rect(&rectr));
/* source rect 2 partially overlaps rect 1 - dest is src rect 2 */ /* source rect 2 partially overlaps rect 1 - dest is src rect 2 */
SetRect(&rect1, 2431, 626, 3427, 1608); SetRect(&rect1, 2431, 626, 3427, 1608);
...@@ -94,22 +94,22 @@ static void test_SubtractRect(void) ...@@ -94,22 +94,22 @@ static void test_SubtractRect(void)
result = SubtractRect(&rect2, &rect1, &rect2); result = SubtractRect(&rect2, &rect1, &rect2);
ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n");
ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499 ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499
&& rectr.bottom == 1608, "wrong rect subtraction of SubtractRect " && rectr.bottom == 1608, "wrong rect subtraction of SubtractRect (dest rect=%s)\n",
"(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); wine_dbgstr_rect(&rectr));
/* source rect 2 completely overlaps rect 1 */ /* source rect 2 completely overlaps rect 1 */
SetRect(&rect1, 250, 250, 400, 500); SetRect(&rect1, 250, 250, 400, 500);
SetRect(&rect2, 50, 50, 1500, 1000); SetRect(&rect2, 50, 50, 1500, 1000);
result = SubtractRect(&rectr, &rect1, &rect2); result = SubtractRect(&rectr, &rect1, &rect2);
ok(!result, "SubtractRect returned TRUE but subtraction should be empty " ok(!result, "SubtractRect returned TRUE but subtraction should be empty (dest rect=%s)\n",
"(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); wine_dbgstr_rect(&rectr));
/* source rect 2 completely overlaps rect 1 - dest is src rect 2 */ /* source rect 2 completely overlaps rect 1 - dest is src rect 2 */
SetRect(&rect1, 250, 250, 400, 500); SetRect(&rect1, 250, 250, 400, 500);
SetRect(&rect2, 50, 50, 1500, 1000); SetRect(&rect2, 50, 50, 1500, 1000);
result = SubtractRect(&rect2, &rect1, &rect2); result = SubtractRect(&rect2, &rect1, &rect2);
ok(!result, "SubtractRect returned TRUE but subtraction should be empty " ok(!result, "SubtractRect returned TRUE but subtraction should be empty (dest rect=%s)\n",
"(dest rect={%d, %d, %d, %d})\n", rect2.left, rect2.top, rect2.right, rect2.bottom); wine_dbgstr_rect(&rect2));
} }
static void test_EqualRect(void) static void test_EqualRect(void)
......
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