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
a3ed938e
Commit
a3ed938e
authored
Jan 06, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Add some missing return value checks (Coverity).
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3bacfc30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
17 deletions
+33
-17
font.c
dlls/gdiplus/tests/font.c
+2
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+24
-12
image.c
dlls/gdiplus/tests/image.c
+1
-1
region.c
dlls/gdiplus/tests/region.c
+6
-3
No files found.
dlls/gdiplus/tests/font.c
View file @
a3ed938e
...
...
@@ -159,7 +159,8 @@ static void test_createfont(void)
expect
(
Ok
,
stat
);
GdipGetFontSize
(
font
,
&
size
);
ok
(
size
==
24
,
"Expected 24, got %f (with unit: %d)
\n
"
,
size
,
i
);
GdipGetFontUnit
(
font
,
&
unit
);
stat
=
GdipGetFontUnit
(
font
,
&
unit
);
ok
(
stat
==
Ok
,
"Failed to get font unit, %d.
\n
"
,
stat
);
expect
(
i
,
unit
);
GdipDeleteFont
(
font
);
}
...
...
dlls/gdiplus/tests/graphics.c
View file @
a3ed938e
...
...
@@ -347,7 +347,8 @@ static void test_save_restore(void)
log_state
(
state_a
,
&
state_log
);
/* A state created by BeginContainer cannot be restored with RestoreGraphics. */
GdipCreateFromHDC
(
hdc
,
&
graphics1
);
stat
=
GdipCreateFromHDC
(
hdc
,
&
graphics1
);
expect
(
Ok
,
stat
);
GdipSetInterpolationMode
(
graphics1
,
InterpolationModeBilinear
);
stat
=
GdipBeginContainer2
(
graphics1
,
&
state_a
);
expect
(
Ok
,
stat
);
...
...
@@ -703,7 +704,8 @@ static void test_BeginContainer2(void)
GdipGetTextContrast
(
graphics
,
&
contrast
);
ok
(
defContrast
==
contrast
,
"Expected Text Contrast to be restored to %d, got %d
\n
"
,
defContrast
,
contrast
);
GdipGetTextRenderingHint
(
graphics
,
&
texthint
);
status
=
GdipGetTextRenderingHint
(
graphics
,
&
texthint
);
expect
(
Ok
,
status
);
ok
(
defTexthint
==
texthint
,
"Expected Text Hint to be restored to %d, got %d
\n
"
,
defTexthint
,
texthint
);
/* test world transform */
...
...
@@ -722,7 +724,8 @@ static void test_BeginContainer2(void)
status
=
GdipCreateMatrix2
(
10
,
20
,
30
,
40
,
50
,
60
,
&
transform
);
expect
(
Ok
,
status
);
GdipSetWorldTransform
(
graphics
,
transform
);
status
=
GdipSetWorldTransform
(
graphics
,
transform
);
expect
(
Ok
,
status
);
GdipDeleteMatrix
(
transform
);
transform
=
NULL
;
...
...
@@ -731,7 +734,8 @@ static void test_BeginContainer2(void)
status
=
GdipCreateMatrix
(
&
transform
);
expect
(
Ok
,
status
);
GdipGetWorldTransform
(
graphics
,
transform
);
status
=
GdipGetWorldTransform
(
graphics
,
transform
);
expect
(
Ok
,
status
);
status
=
GdipGetMatrixElements
(
transform
,
elems
);
expect
(
Ok
,
status
);
ok
(
fabs
(
defTrans
[
0
]
-
elems
[
0
])
<
0
.
0001
&&
...
...
@@ -753,12 +757,14 @@ static void test_BeginContainer2(void)
status
=
GdipBeginContainer2
(
graphics
,
&
cont1
);
expect
(
Ok
,
status
);
GdipSetClipRect
(
graphics
,
defClip
[
0
],
defClip
[
1
],
defClip
[
2
],
defClip
[
3
],
CombineModeReplace
);
status
=
GdipSetClipRect
(
graphics
,
defClip
[
0
],
defClip
[
1
],
defClip
[
2
],
defClip
[
3
],
CombineModeReplace
);
expect
(
Ok
,
status
);
status
=
GdipBeginContainer2
(
graphics
,
&
cont2
);
expect
(
Ok
,
status
);
GdipSetClipRect
(
graphics
,
2
,
4
,
6
,
8
,
CombineModeReplace
);
status
=
GdipSetClipRect
(
graphics
,
2
,
4
,
6
,
8
,
CombineModeReplace
);
expect
(
Ok
,
status
);
status
=
GdipEndContainer
(
graphics
,
cont2
);
expect
(
Ok
,
status
);
...
...
@@ -6572,12 +6578,18 @@ static void test_GdipFillRectanglesOnBitmapTextureBrush(void)
GdipDeleteBrush
((
GpBrush
*
)
brush
);
GdipDeleteGraphics
(
graphics
);
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
0
,
0
,
&
color
[
0
]);
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
0
,
1
,
&
color
[
1
]);
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
1
,
0
,
&
color
[
2
]);
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
width
/
2
,
0
,
&
color
[
3
]);
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
width
/
2
,
height
/
2
,
&
color
[
4
]);
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
0
,
height
/
2
,
&
color
[
5
]);
status
=
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
0
,
0
,
&
color
[
0
]);
expect
(
Ok
,
status
);
status
=
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
0
,
1
,
&
color
[
1
]);
expect
(
Ok
,
status
);
status
=
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
1
,
0
,
&
color
[
2
]);
expect
(
Ok
,
status
);
status
=
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
width
/
2
,
0
,
&
color
[
3
]);
expect
(
Ok
,
status
);
status
=
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
width
/
2
,
height
/
2
,
&
color
[
4
]);
expect
(
Ok
,
status
);
status
=
GdipBitmapGetPixel
(
dst_img
.
bitmap
,
0
,
height
/
2
,
&
color
[
5
]);
expect
(
Ok
,
status
);
ok
(
is_blue_color
(
color
[
0
])
&&
is_blue_color
(
color
[
1
])
&&
is_blue_color
(
color
[
2
])
&&
color
[
3
]
==
0
&&
color
[
4
]
==
0
&&
color
[
5
]
==
0
,
...
...
dlls/gdiplus/tests/image.c
View file @
a3ed938e
...
...
@@ -2717,7 +2717,7 @@ static void test_multiframegif(void)
expect
(
Ok
,
stat
);
color
=
0xdeadbeef
;
GdipBitmapGetPixel
(
bmp
,
0
,
0
,
&
color
);
stat
=
GdipBitmapGetPixel
(
bmp
,
0
,
0
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0xff000000
,
color
);
...
...
dlls/gdiplus/tests/region.c
View file @
a3ed938e
...
...
@@ -814,7 +814,8 @@ static void test_isinfinite(void)
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
GdipCreateRegion
(
&
region
);
status
=
GdipCreateRegion
(
&
region
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
3
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
20
.
0
,
30
.
0
,
&
m
);
...
...
@@ -860,7 +861,8 @@ static void test_isempty(void)
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
GdipCreateRegion
(
&
region
);
status
=
GdipCreateRegion
(
&
region
);
expect
(
Ok
,
status
);
/* NULL arguments */
status
=
GdipIsEmptyRegion
(
NULL
,
NULL
,
NULL
);
...
...
@@ -1779,7 +1781,8 @@ static void test_getbounds(void)
ok
(
rectf
.
Height
==
100
.
0
,
"Expected height = 0.0, got %.2f
\n
"
,
rectf
.
Height
);
/* the world and page transforms are ignored */
GdipScaleWorldTransform
(
graphics
,
2
.
0
,
2
.
0
,
MatrixOrderPrepend
);
status
=
GdipScaleWorldTransform
(
graphics
,
2
.
0
,
2
.
0
,
MatrixOrderPrepend
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
GdipSetPageUnit
(
graphics
,
UnitInch
);
GdipSetPageScale
(
graphics
,
2
.
0
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
rectf
);
...
...
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