[PATCH 1/3] gdiplus/tests: Use much smaller fudge factor in test_widen_cap.

Jeff Smith whydoubt at gmail.com
Mon Mar 2 13:02:34 CST 2020


Signed-off-by: Jeff Smith <whydoubt at gmail.com>
---
 dlls/gdiplus/tests/graphicspath.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c
index aabacef3aa..8c025a4eca 100644
--- a/dlls/gdiplus/tests/graphicspath.c
+++ b/dlls/gdiplus/tests/graphicspath.c
@@ -75,7 +75,8 @@ typedef struct
     int todo;
 } path_test_t;
 
-static void ok_path(GpPath* path, const path_test_t *expected, INT expected_size, BOOL todo_size)
+#define ok_path(a,b,c,d) ok_path_fudge(a,b,c,d,2.0)
+static void ok_path_fudge(GpPath* path, const path_test_t *expected, INT expected_size, BOOL todo_size, REAL fudge)
 {
     BYTE * types;
     INT size, idx = 0, eidx = 0, numskip;
@@ -104,8 +105,8 @@ static void ok_path(GpPath* path, const path_test_t *expected, INT expected_size
         /* We allow a few pixels fudge in matching X and Y coordinates to account for imprecision in
          * floating point to integer conversion */
         BOOL match = (types[idx] == expected[eidx].type) &&
-            fabs(points[idx].X - expected[eidx].X) <= 2.0 &&
-            fabs(points[idx].Y - expected[eidx].Y) <= 2.0;
+            fabs(points[idx].X - expected[eidx].X) <= fudge &&
+            fabs(points[idx].Y - expected[eidx].Y) <= fudge;
 
         stringify_point_type(expected[eidx].type, ename);
         stringify_point_type(types[idx], name);
@@ -1416,7 +1417,7 @@ static void test_widen_cap(void)
 
         status = GdipWidenPath(path, pen, NULL, FlatnessDefault);
         expect(Ok, status);
-        ok_path(path, caps[i].expected, caps[i].expected_size, caps[i].todo_size);
+        ok_path_fudge(path, caps[i].expected, caps[i].expected_size, caps[i].todo_size, 0.000005);
     }
 
     GdipDeletePen(pen);
-- 
2.23.0




More information about the wine-devel mailing list