[PATCH 3/3] user32/tests: Finish the move to use wine_dbgstr_rect().

Michael Stefaniuc mstefani at redhat.de
Mon Jun 20 05:08:13 CDT 2016


Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
I had hoped to totally replace the EMPTY() macro but this macro is much
sticter: Width AND height need to be zero as opposed to IsRectEmpty()
where width OR height need to be equal or less than zero.

And in four tests DrawTextExA indeed returns a rect with zero width but
non zero height:
https://testbot.winehq.org/JobDetails.pl?Key=23592
Not sure if the exact size matters as Windows returns for those tests
a 10,10-10,25 rect as opposed to 10,10-10,24 in Wine.



 dlls/user32/tests/text.c | 34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)

diff --git a/dlls/user32/tests/text.c b/dlls/user32/tests/text.c
index e04f1e3..8438f10 100644
--- a/dlls/user32/tests/text.c
+++ b/dlls/user32/tests/text.c
@@ -130,15 +130,12 @@ static void test_DrawTextCalcRect(void)
     SetRect( &rect, 10,10, 100, 100);
     SetLastError( 0);
     heightcheck = textheight = DrawTextExA(hdc, emptystring, -1, &rect, DT_CALCRECT, NULL );
-    ok( EMPTY(rect),
-        "rectangle should be empty got %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
+    ok(EMPTY(rect), "rectangle should be empty got %s\n", wine_dbgstr_rect(&rect));
     ok(textheight!=0,"Failed to get textheight from DrawTextExA\n");
 
     SetRect( &rect, 10,10, 100, 100);
     textheight = DrawTextA(hdc, emptystring, -1, &rect, DT_CALCRECT);
-    ok( EMPTY(rect),
-        "rectangle should be empty got %d,%d-%d,%d\n",
-        rect.left, rect.top, rect.right, rect.bottom );
+    ok(EMPTY(rect), "rectangle should be empty got %s\n", wine_dbgstr_rect(&rect));
     ok(textheight!=0,"Failed to get textheight from DrawTextA\n");
     ok(textheight == heightcheck,"DrawTextEx and DrawText differ in return\n");
 
@@ -197,15 +194,14 @@ static void test_DrawTextCalcRect(void)
     SetRect( &rect, 10,10, 100, 100);
     SetLastError( 0);
     heightcheck = textheight = DrawTextExA(hdc, emptystring, -1, &rect, DT_CALCRECT|DT_SINGLELINE, NULL );
-    ok( !EMPTY(rect) && MODIFIED(rect),
-        "rectangle should be modified got %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom );
+    ok(!EMPTY(rect) && MODIFIED(rect), "rectangle should be modified got %s\n",
+       wine_dbgstr_rect(&rect));
     ok(textheight!=0,"Failed to get textheight from DrawTextExA\n");
 
     SetRect( &rect, 10,10, 100, 100);
     textheight = DrawTextA(hdc, emptystring, -1, &rect, DT_CALCRECT|DT_SINGLELINE);
-    ok( !EMPTY(rect) && MODIFIED (rect),
-        "rectangle should be modified got %d,%d-%d,%d\n",
-        rect.left, rect.top, rect.right, rect.bottom );
+    ok(!EMPTY(rect) && MODIFIED (rect), "rectangle should be modified got %s\n",
+       wine_dbgstr_rect(&rect));
     ok(textheight!=0,"Failed to get textheight from DrawTextA\n");
     ok(textheight == heightcheck,"DrawTextEx and DrawText differ in return\n");
 
@@ -339,16 +335,12 @@ static void test_DrawTextCalcRect(void)
 
         SetRect( &rect, 10,10, 100, 100);
         heightcheck = textheight = DrawTextExW(hdc, emptystringW, -1, &rect, DT_CALCRECT, NULL );
-        ok( EMPTY(rect),
-            "rectangle should be empty got %d,%d-%d,%d\n",
-            rect.left, rect.top, rect.right, rect.bottom );
+        ok(EMPTY(rect), "rectangle should be empty got %s\n", wine_dbgstr_rect(&rect));
         ok(textheight!=0,"Failed to get textheight from DrawTextExW\n");
 
         SetRect( &rect, 10,10, 100, 100);
         textheight = DrawTextW(hdc, emptystringW, -1, &rect, DT_CALCRECT);
-        ok( EMPTY(rect),
-            "rectangle should be empty got %d,%d-%d,%d\n",
-            rect.left, rect.top, rect.right, rect.bottom );
+        ok(EMPTY(rect), "rectangle should be empty got %s\n", wine_dbgstr_rect(&rect));
         ok(textheight!=0,"Failed to get textheight from DrawTextW\n");
         ok(textheight == heightcheck,"DrawTextEx and DrawText differ in return\n");
 
@@ -406,16 +398,14 @@ static void test_DrawTextCalcRect(void)
 
         SetRect( &rect, 10,10, 100, 100);
         heightcheck = textheight = DrawTextExW(hdc, emptystringW, -1, &rect, DT_CALCRECT|DT_SINGLELINE, NULL );
-        ok( !EMPTY(rect) && MODIFIED(rect),
-            "rectangle should be modified got %d,%d-%d,%d\n",
-            rect.left, rect.top, rect.right, rect.bottom );
+        ok(!EMPTY(rect) && MODIFIED(rect), "rectangle should be modified got %s\n",
+           wine_dbgstr_rect(&rect));
         ok(textheight!=0,"Failed to get textheight from DrawTextExW\n");
 
         SetRect( &rect, 10,10, 100, 100);
         textheight = DrawTextW(hdc, emptystringW, -1, &rect, DT_CALCRECT|DT_SINGLELINE);
-        ok( !EMPTY(rect) && MODIFIED(rect),
-            "rectangle should be modified got %d,%d-%d,%d\n",
-            rect.left, rect.top, rect.right, rect.bottom );
+        ok(!EMPTY(rect) && MODIFIED(rect), "rectangle should be modified got %s\n",
+           wine_dbgstr_rect(&rect));
         ok(textheight!=0,"Failed to get textheight from DrawTextW\n");
         ok(textheight == heightcheck,"DrawTextEx and DrawText differ in return\n");
 
-- 
2.4.11



More information about the wine-patches mailing list