Commit a3ed938e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus/tests: Add some missing return value checks (Coverity).

parent 3bacfc30
...@@ -159,7 +159,8 @@ static void test_createfont(void) ...@@ -159,7 +159,8 @@ static void test_createfont(void)
expect(Ok, stat); expect(Ok, stat);
GdipGetFontSize (font, &size); GdipGetFontSize (font, &size);
ok (size == 24, "Expected 24, got %f (with unit: %d)\n", size, i); 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); expect (i, unit);
GdipDeleteFont(font); GdipDeleteFont(font);
} }
......
...@@ -347,7 +347,8 @@ static void test_save_restore(void) ...@@ -347,7 +347,8 @@ static void test_save_restore(void)
log_state(state_a, &state_log); log_state(state_a, &state_log);
/* A state created by BeginContainer cannot be restored with RestoreGraphics. */ /* A state created by BeginContainer cannot be restored with RestoreGraphics. */
GdipCreateFromHDC(hdc, &graphics1); stat = GdipCreateFromHDC(hdc, &graphics1);
expect(Ok, stat);
GdipSetInterpolationMode(graphics1, InterpolationModeBilinear); GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
stat = GdipBeginContainer2(graphics1, &state_a); stat = GdipBeginContainer2(graphics1, &state_a);
expect(Ok, stat); expect(Ok, stat);
...@@ -703,7 +704,8 @@ static void test_BeginContainer2(void) ...@@ -703,7 +704,8 @@ static void test_BeginContainer2(void)
GdipGetTextContrast(graphics, &contrast); GdipGetTextContrast(graphics, &contrast);
ok(defContrast == contrast, "Expected Text Contrast to be restored to %d, got %d\n", defContrast, 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); ok(defTexthint == texthint, "Expected Text Hint to be restored to %d, got %d\n", defTexthint, texthint);
/* test world transform */ /* test world transform */
...@@ -722,7 +724,8 @@ static void test_BeginContainer2(void) ...@@ -722,7 +724,8 @@ static void test_BeginContainer2(void)
status = GdipCreateMatrix2(10, 20, 30, 40, 50, 60, &transform); status = GdipCreateMatrix2(10, 20, 30, 40, 50, 60, &transform);
expect(Ok, status); expect(Ok, status);
GdipSetWorldTransform(graphics, transform); status = GdipSetWorldTransform(graphics, transform);
expect(Ok, status);
GdipDeleteMatrix(transform); GdipDeleteMatrix(transform);
transform = NULL; transform = NULL;
...@@ -731,7 +734,8 @@ static void test_BeginContainer2(void) ...@@ -731,7 +734,8 @@ static void test_BeginContainer2(void)
status = GdipCreateMatrix(&transform); status = GdipCreateMatrix(&transform);
expect(Ok, status); expect(Ok, status);
GdipGetWorldTransform(graphics, transform); status = GdipGetWorldTransform(graphics, transform);
expect(Ok, status);
status = GdipGetMatrixElements(transform, elems); status = GdipGetMatrixElements(transform, elems);
expect(Ok, status); expect(Ok, status);
ok(fabs(defTrans[0] - elems[0]) < 0.0001 && ok(fabs(defTrans[0] - elems[0]) < 0.0001 &&
...@@ -753,12 +757,14 @@ static void test_BeginContainer2(void) ...@@ -753,12 +757,14 @@ static void test_BeginContainer2(void)
status = GdipBeginContainer2(graphics, &cont1); status = GdipBeginContainer2(graphics, &cont1);
expect(Ok, status); 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); status = GdipBeginContainer2(graphics, &cont2);
expect(Ok, status); 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); status = GdipEndContainer(graphics, cont2);
expect(Ok, status); expect(Ok, status);
...@@ -6572,12 +6578,18 @@ static void test_GdipFillRectanglesOnBitmapTextureBrush(void) ...@@ -6572,12 +6578,18 @@ static void test_GdipFillRectanglesOnBitmapTextureBrush(void)
GdipDeleteBrush((GpBrush*)brush); GdipDeleteBrush((GpBrush*)brush);
GdipDeleteGraphics(graphics); GdipDeleteGraphics(graphics);
GdipBitmapGetPixel(dst_img.bitmap, 0, 0, &color[0]); status = GdipBitmapGetPixel(dst_img.bitmap, 0, 0, &color[0]);
GdipBitmapGetPixel(dst_img.bitmap, 0, 1, &color[1]); expect(Ok, status);
GdipBitmapGetPixel(dst_img.bitmap, 1, 0, &color[2]); status = GdipBitmapGetPixel(dst_img.bitmap, 0, 1, &color[1]);
GdipBitmapGetPixel(dst_img.bitmap, width/2, 0, &color[3]); expect(Ok, status);
GdipBitmapGetPixel(dst_img.bitmap, width/2, height/2, &color[4]); status = GdipBitmapGetPixel(dst_img.bitmap, 1, 0, &color[2]);
GdipBitmapGetPixel(dst_img.bitmap, 0, height/2, &color[5]); 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]) && 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, color[3] == 0 && color[4] == 0 && color[5] == 0,
......
...@@ -2717,7 +2717,7 @@ static void test_multiframegif(void) ...@@ -2717,7 +2717,7 @@ static void test_multiframegif(void)
expect(Ok, stat); expect(Ok, stat);
color = 0xdeadbeef; color = 0xdeadbeef;
GdipBitmapGetPixel(bmp, 0, 0, &color); stat = GdipBitmapGetPixel(bmp, 0, 0, &color);
expect(Ok, stat); expect(Ok, stat);
expect(0xff000000, color); expect(0xff000000, color);
......
...@@ -814,7 +814,8 @@ static void test_isinfinite(void) ...@@ -814,7 +814,8 @@ static void test_isinfinite(void)
status = GdipCreateFromHDC(hdc, &graphics); status = GdipCreateFromHDC(hdc, &graphics);
expect(Ok, status); 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); GdipCreateMatrix2(3.0, 0.0, 0.0, 1.0, 20.0, 30.0, &m);
...@@ -860,7 +861,8 @@ static void test_isempty(void) ...@@ -860,7 +861,8 @@ static void test_isempty(void)
status = GdipCreateFromHDC(hdc, &graphics); status = GdipCreateFromHDC(hdc, &graphics);
expect(Ok, status); expect(Ok, status);
GdipCreateRegion(&region); status = GdipCreateRegion(&region);
expect(Ok, status);
/* NULL arguments */ /* NULL arguments */
status = GdipIsEmptyRegion(NULL, NULL, NULL); status = GdipIsEmptyRegion(NULL, NULL, NULL);
...@@ -1779,7 +1781,8 @@ static void test_getbounds(void) ...@@ -1779,7 +1781,8 @@ static void test_getbounds(void)
ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height); ok(rectf.Height == 100.0, "Expected height = 0.0, got %.2f\n", rectf.Height);
/* the world and page transforms are ignored */ /* 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); GdipSetPageUnit(graphics, UnitInch);
GdipSetPageScale(graphics, 2.0); GdipSetPageScale(graphics, 2.0);
status = GdipGetRegionBounds(region, graphics, &rectf); status = GdipGetRegionBounds(region, graphics, &rectf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment