Jeff Smith : gdiplus/tests: Use much smaller fudge factor in test_widen_cap.
Alexandre Julliard
julliard at winehq.org
Tue Mar 3 16:24:55 CST 2020
Module: wine
Branch: master
Commit: c147f8e3d7fbd8b72943795316ef210dc26ff339
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c147f8e3d7fbd8b72943795316ef210dc26ff339
Author: Jeff Smith <whydoubt at gmail.com>
Date: Mon Mar 2 13:02:34 2020 -0600
gdiplus/tests: Use much smaller fudge factor in test_widen_cap.
Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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);
More information about the wine-cvs
mailing list