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
c2aa66d5
Commit
c2aa66d5
authored
Jun 28, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Add tests for GdipDrawCurve2I.
parent
fe55f0df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
graphics.c
dlls/gdiplus/graphics.c
+1
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+68
-0
No files found.
dlls/gdiplus/graphics.c
View file @
c2aa66d5
...
...
@@ -1514,7 +1514,7 @@ GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen,
TRACE
(
"(%p, %p, %p, %d, %.2f)
\n
"
,
graphics
,
pen
,
points
,
count
,
tension
);
if
(
!
points
||
count
<=
0
)
if
(
!
points
)
return
InvalidParameter
;
pointsF
=
GdipAlloc
(
sizeof
(
GpPointF
)
*
count
);
...
...
dlls/gdiplus/tests/graphics.c
View file @
c2aa66d5
...
...
@@ -428,6 +428,73 @@ static void test_GdipDrawCurve2(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipDrawCurve2I
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpPen
*
pen
=
NULL
;
HDC
hdc
=
GetDC
(
0
);
GpPoint
points
[
3
];
points
[
0
].
X
=
0
;
points
[
0
].
Y
=
0
;
points
[
1
].
X
=
40
;
points
[
1
].
Y
=
20
;
points
[
2
].
X
=
10
;
points
[
2
].
Y
=
40
;
/* make a graphics object and pen object */
ok
(
hdc
!=
NULL
,
"Expected HDC to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
graphics
!=
NULL
,
"Expected graphics to be initialized
\n
"
);
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
/* InvalidParameter cases: null graphics, null pen */
status
=
GdipDrawCurve2I
(
NULL
,
NULL
,
points
,
3
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve2I
(
graphics
,
NULL
,
points
,
3
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve2I
(
NULL
,
pen
,
points
,
3
,
1
);
expect
(
InvalidParameter
,
status
);
/* InvalidParameter cases: invalid count */
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
-
1
,
1
);
expect
(
OutOfMemory
,
status
);
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
0
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
1
,
1
);
expect
(
InvalidParameter
,
status
);
/* Valid test cases */
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
2
,
1
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
3
,
2
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
3
,
-
2
);
expect
(
Ok
,
status
);
status
=
GdipDrawCurve2I
(
graphics
,
pen
,
points
,
3
,
0
);
expect
(
Ok
,
status
);
GdipDeletePen
(
pen
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipDrawCurve
(
void
)
{
GpStatus
status
;
...
...
@@ -1277,6 +1344,7 @@ START_TEST(graphics)
test_GdipDrawCurve
();
test_GdipDrawCurveI
();
test_GdipDrawCurve2
();
test_GdipDrawCurve2I
();
test_GdipDrawLineI
();
test_GdipDrawLinesI
();
test_GdipDrawString
();
...
...
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