-- v2: gdiplus: Fix default tension for GdipAddPathCurve and GdipAddPathClosedCurve gdiplus/test: Add default tension tests for GdipAddPath*Curve
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/tests/graphicspath.c | 43 ++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 908ca8bcaf0..ba7ee0ea307 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -75,7 +75,7 @@ typedef struct int todo; } path_test_t;
-#define ok_path(a,b,c,d) _ok_path_fudge(a,b,c,d,2.0,__LINE__) +#define ok_path(a,b,c,d) _ok_path_fudge(a,b,c,d,1.0,__LINE__) #define ok_path_fudge(a,b,c,d,e) _ok_path_fudge(a,b,c,d,e,__LINE__) static void _ok_path_fudge(GpPath* path, const path_test_t *expected, INT expected_size, BOOL todo_size, REAL fudge, int line) @@ -919,6 +919,18 @@ static path_test_t addcurve_path[] = { {23.3, 13.3, PathPointTypeBezier, 0, 0}, /*8*/ {30.0, 10.0, PathPointTypeBezier, 0, 0} /*9*/ }; +static path_test_t addcurve_path_default_tension[] = { + {0.0, 0.0, PathPointTypeStart, 0, 0}, /*0*/ + {1.66, 1.66, PathPointTypeBezier, 0, 1}, /*1*/ + {8.33, 6.66, PathPointTypeBezier, 0, 1}, /*2*/ + {10.0, 10.0, PathPointTypeBezier, 0, 0}, /*3*/ + {11.6, 13.3, PathPointTypeBezier, 0, 1}, /*4*/ + {6.66, 20.0, PathPointTypeBezier, 0, 1}, /*5*/ + {10.0, 20.0, PathPointTypeBezier, 0, 0}, /*6*/ + {13.3, 20.0, PathPointTypeBezier, 0, 1}, /*7*/ + {26.6, 11.6, PathPointTypeBezier, 0, 1}, /*8*/ + {30.0, 10.0, PathPointTypeBezier, 0, 0} /*9*/ + }; static path_test_t addcurve_path2[] = { {100.0,120.0,PathPointTypeStart, 0, 0}, /*0*/ {123.0,10.0, PathPointTypeLine, 0, 0}, /*1*/ @@ -975,6 +987,13 @@ static void test_addcurve(void) ok_path(path, addcurve_path, ARRAY_SIZE(addcurve_path), FALSE); GdipDeletePath(path);
+ /* add to empty path with default tension */ + GdipCreatePath(FillModeAlternate, &path); + status = GdipAddPathCurve(path, points, 4); + expect(Ok, status); + ok_path(path, addcurve_path_default_tension, ARRAY_SIZE(addcurve_path_default_tension), FALSE); + GdipDeletePath(path); + /* add to notempty path and opened figure */ GdipCreatePath(FillModeAlternate, &path); GdipAddPathLine(path, 100.0, 120.0, 123.0, 10.0); @@ -1030,6 +1049,21 @@ static path_test_t addclosedcurve_path[] = { {6.7, 0.0, PathPointTypeBezier, 0, 0}, /*11*/ {0.0, 0.0, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 0} /*12*/ }; +static path_test_t addclosedcurve_path_default_tension[] = { + {0.0, 0.0, PathPointTypeStart, 0, 0}, /*0*/ + {-3.33, 0.0, PathPointTypeBezier, 0, 1}, /*1*/ + {8.33, 6.66, PathPointTypeBezier, 0, 1}, /*2*/ + {10.0, 10.0, PathPointTypeBezier, 0, 0}, /*3*/ + {11.6, 13.3, PathPointTypeBezier, 0, 1}, /*4*/ + {6.66, 20.0, PathPointTypeBezier, 0, 1}, /*5*/ + {10.0, 20.0, PathPointTypeBezier, 0, 0}, /*6*/ + {13.3, 20.0, PathPointTypeBezier, 0, 1}, /*7*/ + {31.6, 13.3, PathPointTypeBezier, 0, 1}, /*8*/ + {30.0, 10.0, PathPointTypeBezier, 0, 0}, /*9*/ + {28.3, 6.66, PathPointTypeBezier, 0, 1}, /*10*/ + {3.33, 0.0, PathPointTypeBezier, 0, 1}, /*11*/ + {0.0, 0.0, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 0} /*12*/ + }; static void test_addclosedcurve(void) { GpStatus status; @@ -1062,6 +1096,13 @@ static void test_addclosedcurve(void) expect(Ok, status); ok_path(path, addclosedcurve_path, ARRAY_SIZE(addclosedcurve_path), FALSE); GdipDeletePath(path); + + /* add to empty path with default tension */ + GdipCreatePath(FillModeAlternate, &path); + status = GdipAddPathClosedCurve(path, points, 4); + expect(Ok, status); + ok_path(path, addclosedcurve_path_default_tension, ARRAY_SIZE(addclosedcurve_path_default_tension), FALSE); + GdipDeletePath(path); }
static path_test_t reverse_path[] = {
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/graphicspath.c | 8 ++++---- dlls/gdiplus/tests/graphicspath.c | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 8e436f96f4e..75a59470cb2 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -421,7 +421,7 @@ GpStatus WINGDIPAPI GdipAddPathClosedCurve(GpPath *path, GDIPCONST GpPointF *poi { TRACE("(%p, %p, %d)\n", path, points, count);
- return GdipAddPathClosedCurve2(path, points, count, 1.0); + return GdipAddPathClosedCurve2(path, points, count, 0.5); }
GpStatus WINGDIPAPI GdipAddPathClosedCurveI(GpPath *path, GDIPCONST GpPoint *points, @@ -429,7 +429,7 @@ GpStatus WINGDIPAPI GdipAddPathClosedCurveI(GpPath *path, GDIPCONST GpPoint *poi { TRACE("(%p, %p, %d)\n", path, points, count);
- return GdipAddPathClosedCurve2I(path, points, count, 1.0); + return GdipAddPathClosedCurve2I(path, points, count, 0.5); }
GpStatus WINGDIPAPI GdipAddPathClosedCurve2(GpPath *path, GDIPCONST GpPointF *points, @@ -537,7 +537,7 @@ GpStatus WINGDIPAPI GdipAddPathCurve(GpPath *path, GDIPCONST GpPointF *points, I if(!path || !points || count <= 1) return InvalidParameter;
- return GdipAddPathCurve2(path, points, count, 1.0); + return GdipAddPathCurve2(path, points, count, 0.5); }
GpStatus WINGDIPAPI GdipAddPathCurveI(GpPath *path, GDIPCONST GpPoint *points, INT count) @@ -547,7 +547,7 @@ GpStatus WINGDIPAPI GdipAddPathCurveI(GpPath *path, GDIPCONST GpPoint *points, I if(!path || !points || count <= 1) return InvalidParameter;
- return GdipAddPathCurve2I(path, points, count, 1.0); + return GdipAddPathCurve2I(path, points, count, 0.5); }
GpStatus WINGDIPAPI GdipAddPathCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count, diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index ba7ee0ea307..5cb692902ae 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -921,14 +921,14 @@ static path_test_t addcurve_path[] = { }; static path_test_t addcurve_path_default_tension[] = { {0.0, 0.0, PathPointTypeStart, 0, 0}, /*0*/ - {1.66, 1.66, PathPointTypeBezier, 0, 1}, /*1*/ - {8.33, 6.66, PathPointTypeBezier, 0, 1}, /*2*/ + {1.66, 1.66, PathPointTypeBezier, 0, 0}, /*1*/ + {8.33, 6.66, PathPointTypeBezier, 0, 0}, /*2*/ {10.0, 10.0, PathPointTypeBezier, 0, 0}, /*3*/ - {11.6, 13.3, PathPointTypeBezier, 0, 1}, /*4*/ - {6.66, 20.0, PathPointTypeBezier, 0, 1}, /*5*/ + {11.6, 13.3, PathPointTypeBezier, 0, 0}, /*4*/ + {6.66, 20.0, PathPointTypeBezier, 0, 0}, /*5*/ {10.0, 20.0, PathPointTypeBezier, 0, 0}, /*6*/ - {13.3, 20.0, PathPointTypeBezier, 0, 1}, /*7*/ - {26.6, 11.6, PathPointTypeBezier, 0, 1}, /*8*/ + {13.3, 20.0, PathPointTypeBezier, 0, 0}, /*7*/ + {26.6, 11.6, PathPointTypeBezier, 0, 0}, /*8*/ {30.0, 10.0, PathPointTypeBezier, 0, 0} /*9*/ }; static path_test_t addcurve_path2[] = { @@ -1051,17 +1051,17 @@ static path_test_t addclosedcurve_path[] = { }; static path_test_t addclosedcurve_path_default_tension[] = { {0.0, 0.0, PathPointTypeStart, 0, 0}, /*0*/ - {-3.33, 0.0, PathPointTypeBezier, 0, 1}, /*1*/ - {8.33, 6.66, PathPointTypeBezier, 0, 1}, /*2*/ + {-3.33, 0.0, PathPointTypeBezier, 0, 0}, /*1*/ + {8.33, 6.66, PathPointTypeBezier, 0, 0}, /*2*/ {10.0, 10.0, PathPointTypeBezier, 0, 0}, /*3*/ - {11.6, 13.3, PathPointTypeBezier, 0, 1}, /*4*/ - {6.66, 20.0, PathPointTypeBezier, 0, 1}, /*5*/ + {11.6, 13.3, PathPointTypeBezier, 0, 0}, /*4*/ + {6.66, 20.0, PathPointTypeBezier, 0, 0}, /*5*/ {10.0, 20.0, PathPointTypeBezier, 0, 0}, /*6*/ - {13.3, 20.0, PathPointTypeBezier, 0, 1}, /*7*/ - {31.6, 13.3, PathPointTypeBezier, 0, 1}, /*8*/ + {13.3, 20.0, PathPointTypeBezier, 0, 0}, /*7*/ + {31.6, 13.3, PathPointTypeBezier, 0, 0}, /*8*/ {30.0, 10.0, PathPointTypeBezier, 0, 0}, /*9*/ - {28.3, 6.66, PathPointTypeBezier, 0, 1}, /*10*/ - {3.33, 0.0, PathPointTypeBezier, 0, 1}, /*11*/ + {28.3, 6.66, PathPointTypeBezier, 0, 0}, /*10*/ + {3.33, 0.0, PathPointTypeBezier, 0, 0}, /*11*/ {0.0, 0.0, PathPointTypeBezier | PathPointTypeCloseSubpath, 0, 0} /*12*/ }; static void test_addclosedcurve(void)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139219
Your paranoid android.
=== debian11b (64 bit WoW report) ===
mshtml: Unhandled exception: page fault on write access to 0x0000000000000000 in 64-bit code (0x0000007b71bc69).
On Fri Oct 27 16:42:22 2023 +0000, Nikolay Sivov wrote:
It's a good example where having tests in a first commit with todo's will make it clear if changes made any difference.
Fixed
This merge request was approved by Esme Povirk.