Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c4248e97
Commit
c4248e97
authored
Aug 11, 2023
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add new test cases to GdipCreateCustomLineCap.
parent
af3014b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
customlinecap.c
dlls/gdiplus/customlinecap.c
+3
-2
customlinecap.c
dlls/gdiplus/tests/customlinecap.c
+31
-5
No files found.
dlls/gdiplus/customlinecap.c
View file @
c4248e97
...
...
@@ -105,8 +105,9 @@ static GpStatus init_custom_linecap(GpCustomLineCap *cap, GpPathData *pathdata,
return
Ok
;
}
/* FIXME: Sometimes when fillPath is non-null and stroke path is null, the native
* version of this function returns NotImplemented. I cannot figure out why. */
/* Custom line cap position (0, 0) is a place corresponding to the end of line.
* If Custom Line Cap is too big and too far from position (0, 0),
* then NotImplemented will be returned, due to floating point precision limitation. */
GpStatus
WINGDIPAPI
GdipCreateCustomLineCap
(
GpPath
*
fillPath
,
GpPath
*
strokePath
,
GpLineCap
baseCap
,
REAL
baseInset
,
GpCustomLineCap
**
customCap
)
{
...
...
dlls/gdiplus/tests/customlinecap.c
View file @
c4248e97
...
...
@@ -49,17 +49,22 @@ static BOOL compare_float(float f, float g, unsigned int ulps)
static
void
test_constructor_destructor
(
void
)
{
GpCustomLineCap
*
custom
;
GpPath
*
path
,
*
path2
;
GpPath
*
path
,
*
path2
,
*
pathFarAway
;
GpStatus
stat
;
stat
=
GdipCreatePath
(
FillModeAlternate
,
&
path
);
expect
(
Ok
,
stat
);
stat
=
GdipAddPathRectangle
(
path
,
5
.
0
,
5
.
0
,
10
.
0
,
10
.
0
);
stat
=
GdipAddPathRectangle
(
path
,
-
5
.
0
,
-
4
.
0
,
10
.
0
,
8
.
0
);
expect
(
Ok
,
stat
);
stat
=
GdipCreatePath
(
FillModeAlternate
,
&
path2
);
expect
(
Ok
,
stat
);
stat
=
GdipAddPathRectangle
(
path2
,
5
.
0
,
5
.
0
,
10
.
0
,
10
.
0
);
stat
=
GdipAddPathRectangle
(
path2
,
-
5
.
0
,
-
5
.
0
,
10
.
0
,
10
.
0
);
expect
(
Ok
,
stat
);
stat
=
GdipCreatePath
(
FillModeAlternate
,
&
pathFarAway
);
expect
(
Ok
,
stat
);
stat
=
GdipAddPathRectangle
(
pathFarAway
,
5
.
0
,
5
.
0
,
10
.
0
,
10
.
0
);
expect
(
Ok
,
stat
);
/* NULL args */
...
...
@@ -74,18 +79,39 @@ static void test_constructor_destructor(void)
stat
=
GdipDeleteCustomLineCap
(
NULL
);
expect
(
InvalidParameter
,
stat
);
/* If both parameters are provided, then fillPath will be ignored. */
custom
=
NULL
;
stat
=
GdipCreateCustomLineCap
(
path
,
path2
,
LineCapFlat
,
0
.
0
,
&
custom
);
expect
(
Ok
,
stat
);
ok
(
custom
!=
NULL
,
"Custom line cap was not created
\n
"
);
stat
=
GdipDeleteCustomLineCap
(
custom
);
expect
(
Ok
,
stat
);
/* valid args */
custom
=
NULL
;
stat
=
GdipCreateCustomLineCap
(
NULL
,
path2
,
LineCapFlat
,
0
.
0
,
&
custom
);
expect
(
Ok
,
stat
);
ok
(
custom
!=
NULL
,
"Custom line cap was not created
\n
"
);
stat
=
GdipDeleteCustomLineCap
(
custom
);
expect
(
Ok
,
stat
);
custom
=
NULL
;
stat
=
GdipCreateCustomLineCap
(
path
,
NULL
,
LineCapFlat
,
0
.
0
,
&
custom
);
expect
(
Ok
,
stat
);
ok
(
custom
!=
NULL
,
"Custom line cap was not created
\n
"
);
stat
=
GdipDeleteCustomLineCap
(
custom
);
expect
(
Ok
,
stat
);
/* it's strange but native returns NotImplemented on stroke == NULL */
/* Custom line cap position (0, 0) is a place corresponding to the end of line.
* If Custom Line Cap is too big and too far from position (0, 0),
* then NotImplemented will be returned, due to floating point precision limitation. */
custom
=
NULL
;
stat
=
GdipCreateCustomLineCap
(
path
,
NULL
,
LineCapFlat
,
10
.
0
,
&
custom
);
stat
=
GdipCreateCustomLineCap
(
path
FarAway
,
NULL
,
LineCapFlat
,
10
.
0
,
&
custom
);
todo_wine
expect
(
NotImplemented
,
stat
);
todo_wine
ok
(
custom
==
NULL
,
"Expected a failure on creation
\n
"
);
if
(
stat
==
Ok
)
GdipDeleteCustomLineCap
(
custom
);
GdipDeletePath
(
pathFarAway
);
GdipDeletePath
(
path2
);
GdipDeletePath
(
path
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment