gdi32/tests: Add a context to the testJustification() failure message.

It is called in three places so this allows identifying which one
failed.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francois Gouget 2021-06-10 14:11:58 +02:00 committed by Alexandre Julliard
parent 8104629672
commit a82ab29308

View file

@ -2376,7 +2376,7 @@ static void test_GetOutlineTextMetrics(void)
ReleaseDC(0, hdc);
}
static void testJustification(HDC hdc, PCSTR str, RECT *clientArea)
static void testJustification(const char *context, HDC hdc, PCSTR str, RECT *clientArea)
{
INT y,
breakCount,
@ -2447,8 +2447,8 @@ static void testJustification(HDC hdc, PCSTR str, RECT *clientArea)
/* The width returned by GetTextExtentPoint32() is exactly the same
returned by GetTextExtentExPointW() - see dlls/gdi32/font.c */
ok(error[e].GetTextExtentExPointWWidth == areaWidth,
"GetTextExtentPointW() for \"%.*s\" should have returned a width of %d, not %d.\n",
error[e].len, error[e].start, areaWidth, error[e].GetTextExtentExPointWWidth);
"%s: GetTextExtentPointW() for \"%.*s\" should have returned a width of %d, not %d.\n",
context, error[e].len, error[e].start, areaWidth, error[e].GetTextExtentExPointWWidth);
}
}
@ -2491,7 +2491,7 @@ static void test_SetTextJustification(void)
hfont = create_font("Times New Roman", &lf);
SelectObject(hdc, hfont);
testJustification(hdc, testText, &clientArea);
testJustification("default", hdc, testText, &clientArea);
if (!pGetTextExtentExPointI) goto done;
GetGlyphIndicesA( hdc, "A ", 2, indices, 0 );
@ -2528,7 +2528,7 @@ static void test_SetTextJustification(void)
SetWindowExtEx( hdc, 2, 2, NULL );
GetClientRect( hwnd, &clientArea );
DPtoLP( hdc, (POINT *)&clientArea, 2 );
testJustification(hdc, testText, &clientArea);
testJustification("2x2", hdc, testText, &clientArea);
GetTextExtentPoint32A(hdc, "A", 1, &expect);
for (i = 0; i < 10; i++)
@ -2550,7 +2550,7 @@ static void test_SetTextJustification(void)
SetViewportExtEx( hdc, 3, 3, NULL );
GetClientRect( hwnd, &clientArea );
DPtoLP( hdc, (POINT *)&clientArea, 2 );
testJustification(hdc, testText, &clientArea);
testJustification("3x3", hdc, testText, &clientArea);
GetTextExtentPoint32A(hdc, "A", 1, &expect);
for (i = 0; i < 10; i++)