riched20/tests: Use wine_dbgstr_rect() to print RECTs.
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
27ea3804dd
commit
f18f44c505
|
@ -7050,9 +7050,8 @@ static void test_format_rect(void)
|
||||||
expected.left += 1;
|
expected.left += 1;
|
||||||
expected.right -= 1;
|
expected.right -= 1;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
for (n = -3; n <= 3; n++)
|
for (n = -3; n <= 3; n++)
|
||||||
{
|
{
|
||||||
|
@ -7066,19 +7065,16 @@ static void test_format_rect(void)
|
||||||
expected.bottom = min(clientRect.bottom, rc.bottom);
|
expected.bottom = min(clientRect.bottom, rc.bottom);
|
||||||
expected.right = min(clientRect.right, rc.right);
|
expected.right = min(clientRect.right, rc.right);
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected),
|
ok(EqualRect(&rc, &expected), "[n=%d] rect %s != %s\n", n, wine_dbgstr_rect(&rc),
|
||||||
"[n=%d] rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
wine_dbgstr_rect(&expected));
|
||||||
n, rc.top, rc.left, rc.bottom, rc.right,
|
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = clientRect;
|
rc = clientRect;
|
||||||
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
||||||
expected = clientRect;
|
expected = clientRect;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
/* Adding the selectionbar adds the selectionbar width to the left side. */
|
/* Adding the selectionbar adds the selectionbar width to the left side. */
|
||||||
SendMessageA(hwnd, EM_SETOPTIONS, ECOOP_OR, ECO_SELECTIONBAR);
|
SendMessageA(hwnd, EM_SETOPTIONS, ECOOP_OR, ECO_SELECTIONBAR);
|
||||||
|
@ -7086,17 +7082,15 @@ static void test_format_rect(void)
|
||||||
ok(options & ECO_SELECTIONBAR, "EM_SETOPTIONS failed to add selectionbar.\n");
|
ok(options & ECO_SELECTIONBAR, "EM_SETOPTIONS failed to add selectionbar.\n");
|
||||||
expected.left += 8; /* selection bar width */
|
expected.left += 8; /* selection bar width */
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
rc = clientRect;
|
rc = clientRect;
|
||||||
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
||||||
expected = clientRect;
|
expected = clientRect;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
/* Removing the selectionbar subtracts the selectionbar width from the left side,
|
/* Removing the selectionbar subtracts the selectionbar width from the left side,
|
||||||
* even if the left side is already 0. */
|
* even if the left side is already 0. */
|
||||||
|
@ -7105,19 +7099,16 @@ static void test_format_rect(void)
|
||||||
ok(!(options & ECO_SELECTIONBAR), "EM_SETOPTIONS failed to remove selectionbar.\n");
|
ok(!(options & ECO_SELECTIONBAR), "EM_SETOPTIONS failed to remove selectionbar.\n");
|
||||||
expected.left -= 8; /* selection bar width */
|
expected.left -= 8; /* selection bar width */
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
/* Set the absolute value of the formatting rectangle. */
|
/* Set the absolute value of the formatting rectangle. */
|
||||||
rc = clientRect;
|
rc = clientRect;
|
||||||
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
||||||
expected = clientRect;
|
expected = clientRect;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected),
|
ok(EqualRect(&rc, &expected), "[n=%d] rect %s != %s\n", n, wine_dbgstr_rect(&rc),
|
||||||
"[n=%d] rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
wine_dbgstr_rect(&expected));
|
||||||
n, rc.top, rc.left, rc.bottom, rc.right,
|
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
/* MSDN documents the EM_SETRECT message as using the rectangle provided in
|
/* MSDN documents the EM_SETRECT message as using the rectangle provided in
|
||||||
* LPARAM as being a relative offset when the WPARAM value is 1, but these
|
* LPARAM as being a relative offset when the WPARAM value is 1, but these
|
||||||
|
@ -7129,9 +7120,8 @@ static void test_format_rect(void)
|
||||||
expected = rc;
|
expected = rc;
|
||||||
SendMessageA(hwnd, EM_SETRECT, 1, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_SETRECT, 1, (LPARAM)&rc);
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
/* For some reason it does not limit the values to the client rect with
|
/* For some reason it does not limit the values to the client rect with
|
||||||
* a WPARAM value of 1. */
|
* a WPARAM value of 1. */
|
||||||
|
@ -7142,9 +7132,8 @@ static void test_format_rect(void)
|
||||||
expected = rc;
|
expected = rc;
|
||||||
SendMessageA(hwnd, EM_SETRECT, 1, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_SETRECT, 1, (LPARAM)&rc);
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
/* Reset to default rect and check how the format rect adjusts to window
|
/* Reset to default rect and check how the format rect adjusts to window
|
||||||
* resize and how it copes with very small windows */
|
* resize and how it copes with very small windows */
|
||||||
|
@ -7157,9 +7146,8 @@ static void test_format_rect(void)
|
||||||
expected.left += 1;
|
expected.left += 1;
|
||||||
expected.right -= 1;
|
expected.right -= 1;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
MoveWindow(hwnd, 0, 0, 0, 30, FALSE);
|
MoveWindow(hwnd, 0, 0, 0, 30, FALSE);
|
||||||
GetClientRect(hwnd, &clientRect);
|
GetClientRect(hwnd, &clientRect);
|
||||||
|
@ -7168,9 +7156,8 @@ static void test_format_rect(void)
|
||||||
expected.left += 1;
|
expected.left += 1;
|
||||||
expected.right -= 1;
|
expected.right -= 1;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
MoveWindow(hwnd, 0, 0, 100, 0, FALSE);
|
MoveWindow(hwnd, 0, 0, 100, 0, FALSE);
|
||||||
GetClientRect(hwnd, &clientRect);
|
GetClientRect(hwnd, &clientRect);
|
||||||
|
@ -7179,9 +7166,8 @@ static void test_format_rect(void)
|
||||||
expected.left += 1;
|
expected.left += 1;
|
||||||
expected.right -= 1;
|
expected.right -= 1;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
|
@ -7198,9 +7184,8 @@ static void test_format_rect(void)
|
||||||
expected.top += 1;
|
expected.top += 1;
|
||||||
expected.right -= 1;
|
expected.right -= 1;
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
rc = clientRect;
|
rc = clientRect;
|
||||||
InflateRect(&rc, -5, -5);
|
InflateRect(&rc, -5, -5);
|
||||||
|
@ -7210,9 +7195,8 @@ static void test_format_rect(void)
|
||||||
expected.right += 1;
|
expected.right += 1;
|
||||||
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
|
||||||
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
SendMessageA(hwnd, EM_GETRECT, 0, (LPARAM)&rc);
|
||||||
ok(EqualRect(&rc, &expected), "rect a(t=%d, l=%d, b=%d, r=%d) != e(t=%d, l=%d, b=%d, r=%d)\n",
|
ok(EqualRect(&rc, &expected), "rect %s != %s\n", wine_dbgstr_rect(&rc),
|
||||||
rc.top, rc.left, rc.bottom, rc.right,
|
wine_dbgstr_rect(&expected));
|
||||||
expected.top, expected.left, expected.bottom, expected.right);
|
|
||||||
|
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue