gdiplus/tests: Make sure to use return values (LLVM/Clang).
This commit is contained in:
parent
e48b34cdb3
commit
1a24d1c0f1
@ -311,6 +311,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok, status);
|
||||||
expectf(1.0, elements[0]);
|
expectf(1.0, elements[0]);
|
||||||
expectf(1.0, elements[1]);
|
expectf(1.0, elements[1]);
|
||||||
expectf(-1.0, elements[2]);
|
expectf(-1.0, elements[2]);
|
||||||
@ -319,6 +320,7 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(-50.50, elements[5]);
|
expectf(-50.50, elements[5]);
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok, status);
|
||||||
/* vertical gradient */
|
/* vertical gradient */
|
||||||
pt1.X = pt1.Y = pt2.X = 0.0;
|
pt1.X = pt1.Y = pt2.X = 0.0;
|
||||||
pt2.Y = 10.0;
|
pt2.Y = 10.0;
|
||||||
@ -336,6 +338,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok, status);
|
||||||
expectf(0.0, elements[0]);
|
expectf(0.0, elements[0]);
|
||||||
expectf(1.0, elements[1]);
|
expectf(1.0, elements[1]);
|
||||||
expectf(-1.0, elements[2]);
|
expectf(-1.0, elements[2]);
|
||||||
@ -344,6 +347,7 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(5.0, elements[5]);
|
expectf(5.0, elements[5]);
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok, status);
|
||||||
/* horizontal gradient */
|
/* horizontal gradient */
|
||||||
pt1.X = pt1.Y = pt2.Y = 0.0;
|
pt1.X = pt1.Y = pt2.Y = 0.0;
|
||||||
pt2.X = 10.0;
|
pt2.X = 10.0;
|
||||||
@ -361,6 +365,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok, status);
|
||||||
expectf(1.0, elements[0]);
|
expectf(1.0, elements[0]);
|
||||||
expectf(0.0, elements[1]);
|
expectf(0.0, elements[1]);
|
||||||
expectf(0.0, elements[2]);
|
expectf(0.0, elements[2]);
|
||||||
@ -369,6 +374,7 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(0.0, elements[5]);
|
expectf(0.0, elements[5]);
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok, status);
|
||||||
/* slope = -1 */
|
/* slope = -1 */
|
||||||
pt1.X = pt1.Y = 0.0;
|
pt1.X = pt1.Y = 0.0;
|
||||||
pt2.X = 20.0;
|
pt2.X = 20.0;
|
||||||
@ -387,6 +393,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok, status);
|
||||||
expectf(1.0, elements[0]);
|
expectf(1.0, elements[0]);
|
||||||
expectf(-1.0, elements[1]);
|
expectf(-1.0, elements[1]);
|
||||||
expectf(1.0, elements[2]);
|
expectf(1.0, elements[2]);
|
||||||
@ -395,6 +402,7 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(10.0, elements[5]);
|
expectf(10.0, elements[5]);
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok, status);
|
||||||
/* slope = 1/100 */
|
/* slope = 1/100 */
|
||||||
pt1.X = pt1.Y = 0.0;
|
pt1.X = pt1.Y = 0.0;
|
||||||
pt2.X = 100.0;
|
pt2.X = 100.0;
|
||||||
@ -413,6 +421,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok,status);
|
||||||
expectf(1.0, elements[0]);
|
expectf(1.0, elements[0]);
|
||||||
expectf(0.01, elements[1]);
|
expectf(0.01, elements[1]);
|
||||||
expectf(-0.02, elements[2]);
|
expectf(-0.02, elements[2]);
|
||||||
@ -421,6 +430,7 @@ static void test_gradientgetrect(void)
|
|||||||
/* expectf(-1.0, elements[5]); */
|
/* expectf(-1.0, elements[5]); */
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok,status);
|
||||||
/* zero height rect */
|
/* zero height rect */
|
||||||
rectf.X = rectf.Y = 10.0;
|
rectf.X = rectf.Y = 10.0;
|
||||||
rectf.Width = 100.0;
|
rectf.Width = 100.0;
|
||||||
@ -453,6 +463,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok,status);
|
||||||
expectf(1.0, elements[0]);
|
expectf(1.0, elements[0]);
|
||||||
expectf(0.0, elements[1]);
|
expectf(0.0, elements[1]);
|
||||||
expectf(0.0, elements[2]);
|
expectf(0.0, elements[2]);
|
||||||
@ -461,6 +472,7 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(0.0, elements[5]);
|
expectf(0.0, elements[5]);
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok,status);
|
||||||
/* passing negative Width/Height to LinearGradientModeHorizontal */
|
/* passing negative Width/Height to LinearGradientModeHorizontal */
|
||||||
rectf.X = rectf.Y = 10.0;
|
rectf.X = rectf.Y = 10.0;
|
||||||
rectf.Width = rectf.Height = -100.0;
|
rectf.Width = rectf.Height = -100.0;
|
||||||
@ -479,6 +491,7 @@ static void test_gradientgetrect(void)
|
|||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
{
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
expect(Ok,status);
|
||||||
expectf(1.0, elements[0]);
|
expectf(1.0, elements[0]);
|
||||||
expectf(0.0, elements[1]);
|
expectf(0.0, elements[1]);
|
||||||
expectf(0.0, elements[2]);
|
expectf(0.0, elements[2]);
|
||||||
@ -487,6 +500,7 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(0.0, elements[5]);
|
expectf(0.0, elements[5]);
|
||||||
}
|
}
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
expect(Ok,status);
|
||||||
|
|
||||||
GdipDeleteMatrix(transform);
|
GdipDeleteMatrix(transform);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user