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

Alexandre Julliard julliard at winehq.org
Thu Jun 10 16:04:51 CDT 2021


Module: wine
Branch: master
Commit: a82ab29308376991ed492da947f6afdb18dde23f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a82ab29308376991ed492da947f6afdb18dde23f

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Jun 10 14:11:58 2021 +0200

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/tests/font.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index ffb400ba838..4d7887e753f 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -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++)




More information about the wine-cvs mailing list