[PATCH] gdiplus/tests: Check more return values (Coverity)
Nikolay Sivov
nsivov at codeweavers.com
Tue Nov 28 03:05:20 CST 2017
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/gdiplus/tests/font.c | 6 ++++--
dlls/gdiplus/tests/graphics.c | 12 ++++++++----
dlls/gdiplus/tests/image.c | 5 +++--
dlls/gdiplus/tests/pathiterator.c | 15 ++++++++++-----
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index 6c7738cf90..2c7b21b6e8 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -83,7 +83,8 @@ static void test_createfont(void)
for (i = UnitWorld; i <=UnitMillimeter; i++)
{
if (i == UnitDisplay) continue; /* Crashes WindowsXP, wtf? */
- GdipCreateFont(fontfamily, 24, FontStyleRegular, i, &font);
+ stat = GdipCreateFont(fontfamily, 24, FontStyleRegular, i, &font);
+ expect(Ok, stat);
GdipGetFontSize (font, &size);
ok (size == 24, "Expected 24, got %f (with unit: %d)\n", size, i);
GdipGetFontUnit (font, &unit);
@@ -107,7 +108,8 @@ static void test_logfont(void)
UINT16 em_height, line_spacing;
Unit unit;
- GdipCreateFromHDC(hdc, &graphics);
+ stat = GdipCreateFromHDC(hdc, &graphics);
+ expect(Ok, stat);
memset(&lfa, 0, sizeof(LOGFONTA));
memset(&lfa2, 0xff, sizeof(LOGFONTA));
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index a96050b06d..96df1a2743 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -365,7 +365,8 @@ static void test_save_restore(void)
log_state(state_a, &state_log);
/* BeginContainer and SaveGraphics use the same stack. */
- GdipCreateFromHDC(hdc, &graphics1);
+ stat = GdipCreateFromHDC(hdc, &graphics1);
+ expect(Ok, stat);
GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
stat = GdipBeginContainer2(graphics1, &state_a);
expect(Ok, stat);
@@ -731,7 +732,8 @@ static void test_BeginContainer2(void)
status = GdipCreateMatrix(&transform);
expect(Ok, status);
GdipGetWorldTransform(graphics, transform);
- GdipGetMatrixElements(transform, elems);
+ status = GdipGetMatrixElements(transform, elems);
+ expect(Ok, status);
ok(fabs(defTrans[0] - elems[0]) < 0.0001 &&
fabs(defTrans[1] - elems[1]) < 0.0001 &&
fabs(defTrans[2] - elems[2]) < 0.0001 &&
@@ -1600,10 +1602,12 @@ static void test_Get_Release_DC(void)
status = GdipCreateMatrix(&m);
expect(Ok, status);
- GdipCreateRegion(®ion);
+ status = GdipCreateRegion(®ion);
+ expect(Ok, status);
GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
GdipCreatePath(FillModeAlternate, &path);
- GdipCreateRegion(&clip);
+ status = GdipCreateRegion(&clip);
+ expect(Ok, status);
status = GdipCreateFromHDC(hdc, &graphics);
expect(Ok, status);
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index 0b444effb1..28f0fcec93 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -367,7 +367,8 @@ static void test_GdipImageGetFrameDimensionsCount(void)
/* SelectActiveFrame has no effect on image data of memory bitmaps */
color = 0xdeadbeef;
- GdipBitmapGetPixel(bm, 0, 0, &color);
+ stat = GdipBitmapGetPixel(bm, 0, 0, &color);
+ expect(Ok, stat);
expect(0xffffffff, color);
GdipDisposeImage((GpImage*)bm);
@@ -2724,7 +2725,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(0xffffffff, color);
diff --git a/dlls/gdiplus/tests/pathiterator.c b/dlls/gdiplus/tests/pathiterator.c
index 3f6292c6cc..9bd3ac5452 100644
--- a/dlls/gdiplus/tests/pathiterator.c
+++ b/dlls/gdiplus/tests/pathiterator.c
@@ -80,7 +80,8 @@ static void test_hascurve(void)
GdipDeletePathIter(iter);
- GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
+ stat = GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
+ expect(Ok, stat);
stat = GdipCreatePathIter(&iter, path);
expect(Ok, stat);
@@ -330,9 +331,12 @@ static void test_isvalid(void)
GdipDeletePathIter(iter);
/* no markers */
- GdipAddPathLine(path, 50.0, 50.0, 110.0, 40.0);
- GdipCreatePathIter(&iter, path);
- GdipPathIterNextMarker(iter, &result, &start, &end);
+ stat = GdipAddPathLine(path, 50.0, 50.0, 110.0, 40.0);
+ expect(Ok, stat);
+ stat = GdipCreatePathIter(&iter, path);
+ expect(Ok, stat);
+ stat = GdipPathIterNextMarker(iter, &result, &start, &end);
+ expect(Ok, stat);
isvalid = FALSE;
stat = GdipPathIterIsValid(iter, &isvalid);
expect(Ok, stat);
@@ -527,7 +531,8 @@ static void test_nextpathtype(void)
todo_wine expect(0, result);
GdipDeletePathIter(iter);
- GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
+ stat = GdipAddPathEllipse(path, 0.0, 0.0, 35.0, 70.0);
+ expect(Ok, stat);
GdipCreatePathIter(&iter, path);
start = end = result = (INT)0xdeadbeef;
type = 255; /* out of range */
--
2.15.0
More information about the wine-devel
mailing list