Commit eb0eaf70 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3dx9/tests: Avoid using the comma operator (coccinellery).

parent 493fbabb
......@@ -218,7 +218,7 @@ static void D3DXColorTest(void)
scale = 0.3f;
/*_______________D3DXColorAdd________________*/
expected.r = 0.9f; expected.g = 1.05f; expected.b = 0.99f, expected.a = 0.93f;
expected.r = 0.9f; expected.g = 1.05f; expected.b = 0.99f; expected.a = 0.93f;
D3DXColorAdd(&got,&color1,&color2);
expect_color(&expected, &got, 1);
/* Test the NULL case */
......@@ -230,12 +230,12 @@ static void D3DXColorTest(void)
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
/*_______________D3DXColorAdjustContrast______*/
expected.r = 0.41f; expected.g = 0.575f; expected.b = 0.473f, expected.a = 0.93f;
expected.r = 0.41f; expected.g = 0.575f; expected.b = 0.473f; expected.a = 0.93f;
D3DXColorAdjustContrast(&got,&color,scale);
expect_color(&expected, &got, 0);
/*_______________D3DXColorAdjustSaturation______*/
expected.r = 0.486028f; expected.g = 0.651028f; expected.b = 0.549028f, expected.a = 0.93f;
expected.r = 0.486028f; expected.g = 0.651028f; expected.b = 0.549028f; expected.a = 0.93f;
D3DXColorAdjustSaturation(&got,&color,scale);
expect_color(&expected, &got, 16);
......@@ -294,7 +294,7 @@ static void D3DXColorTest(void)
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
/*_______________D3DXColorSubtract_______________*/
expected.r = -0.1f; expected.g = 0.25f; expected.b = -0.35f, expected.a = 0.82f;
expected.r = -0.1f; expected.g = 0.25f; expected.b = -0.35f; expected.a = 0.82f;
D3DXColorSubtract(&got,&color,&color2);
expect_color(&expected, &got, 1);
/* Test the NULL case */
......@@ -1143,8 +1143,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, &r, &last);
expect_matrix(&expectedmat, &gotmat, 32);
q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 1.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 2.0f,
q.x = 1.0f; q.y = 1.0f; q.z = 1.0f; q.w = 1.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 2.0f;
set_matrix(&expectedmat,
41.0f, -12.0f, -24.0f, 0.0f,
......@@ -1154,8 +1154,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 1.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
q.x = 1.0f; q.y = 1.0f; q.z = 1.0f; q.w = 1.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
57.0f, -12.0f, -36.0f, 0.0f,
......@@ -1165,8 +1165,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 0.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
q.x = 1.0f; q.y = 1.0f; q.z = 1.0f; q.w = 0.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
25.0f, 0.0f, -20.0f, 0.0f,
......@@ -1176,8 +1176,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 1.0f, q.z = 0.0f, q.w = 0.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
q.x = 1.0f; q.y = 1.0f; q.z = 0.0f; q.w = 0.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
5.0f, -4.0f, 0.0f, 0.0f,
......@@ -1187,8 +1187,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f,
axis.x = 5.0f, axis.y = 2.0f, axis.z = 1.0f,
q.x = 1.0f; q.y = 0.0f; q.z = 0.0f; q.w = 0.0f;
axis.x = 5.0f; axis.y = 2.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
5.0f, 0.0f, 0.0f, 0.0f,
......@@ -1198,8 +1198,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f,
axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
q.x = 1.0f; q.y = 0.0f; q.z = 0.0f; q.w = 0.0f;
axis.x = 1.0f; axis.y = 4.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
1.0f, 0.0f, 0.0f, 0.0f,
......@@ -1209,8 +1209,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 0.0f, q.y = 1.0f, q.z = 0.0f, q.w = 0.0f,
axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
q.x = 0.0f; q.y = 1.0f; q.z = 0.0f; q.w = 0.0f;
axis.x = 1.0f; axis.y = 4.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
1.0f, 0.0f, 0.0f, 0.0f,
......@@ -1220,8 +1220,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 1.0f,
axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
q.x = 1.0f; q.y = 0.0f; q.z = 0.0f; q.w = 1.0f;
axis.x = 1.0f; axis.y = 4.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
1.0f, 0.0f, 0.0f, 0.0f,
......@@ -1231,8 +1231,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 1.0f,
axis.x = 0.0f, axis.y = 4.0f, axis.z = 0.0f,
q.x = 1.0f; q.y = 0.0f; q.z = 0.0f; q.w = 1.0f;
axis.x = 0.0f; axis.y = 4.0f; axis.z = 0.0f;
set_matrix(&expectedmat,
0.0f, 0.0f, 0.0f, 0.0f,
......@@ -1242,8 +1242,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 0.0f, q.y = 1.0f, q.z = 0.0f, q.w = 1.0f,
axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
q.x = 0.0f; q.y = 1.0f; q.z = 0.0f; q.w = 1.0f;
axis.x = 1.0f; axis.y = 4.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
5.0f, 0.0f, 0.0f, 0.0f,
......@@ -1253,8 +1253,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
q.x = 1.0f; q.y = 0.0f; q.z = 0.0f; q.w = 0.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
1.0f, 0.0f, 0.0f, 0.0f,
......@@ -1264,8 +1264,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 3.0f, axis.y = 3.0f, axis.z = 3.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 3.0f; axis.y = 3.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
3796587.0f, -1377948.0f, -1589940.0f, 0.0f,
......@@ -1275,8 +1275,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 1.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
1265529.0f, -459316.0f, -529980.0f, 0.0f,
......@@ -1286,8 +1286,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 1.0f; axis.y = 1.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
2457497.0f, -434612.0f, -1423956.0f, 0.0f,
......@@ -1297,8 +1297,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 0.0f, axis.y = 0.0f, axis.z = 3.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 0.0f; axis.y = 0.0f; axis.z = 3.0f;
set_matrix(&expectedmat,
1787952.0f, 37056.0f, -1340964.0f, 0.0f,
......@@ -1308,8 +1308,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 0.0f, axis.y = 0.0f, axis.z = 1.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 0.0f; axis.y = 0.0f; axis.z = 1.0f;
set_matrix(&expectedmat,
595984.0f, 12352.0f, -446988.0f, 0.0f,
......@@ -1319,8 +1319,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 0.0f, axis.y = 3.0f, axis.z = 0.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 0.0f; axis.y = 3.0f; axis.z = 0.0f;
set_matrix(&expectedmat,
150528.0f, 464352.0f, -513408.0f, 0.0f,
......@@ -1330,8 +1330,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 0.0f, axis.y = 1.0f, axis.z = 0.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 0.0f; axis.y = 1.0f; axis.z = 0.0f;
set_matrix(&expectedmat,
50176.0f, 154784.0f, -171136.0f, 0.0f,
......@@ -1341,8 +1341,8 @@ static void D3DXMatrixTest(void)
D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
expect_matrix(&expectedmat, &gotmat, 0);
q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
axis.x = 1.0f, axis.y = 0.0f, axis.z = 0.0f,
q.x = 11.0f; q.y = 13.0f; q.z = 15.0f; q.w = 17.0f;
axis.x = 1.0f; axis.y = 0.0f; axis.z = 0.0f;
set_matrix(&expectedmat,
619369.0f, -626452.0f, 88144.0f, 0.0f,
......@@ -1393,35 +1393,35 @@ static void D3DXPlaneTest(void)
/*_______________D3DXPlaneDot________________*/
expected = 42.0f;
got = D3DXPlaneDot(&plane,&vec),
got = D3DXPlaneDot(&plane, &vec);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDot(NULL,&vec),
got = D3DXPlaneDot(NULL, &vec);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDot(NULL,NULL),
got = D3DXPlaneDot(NULL, NULL);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
/*_______________D3DXPlaneDotCoord________________*/
expected = -28.0f;
got = D3DXPlaneDotCoord(&plane,&vec),
got = D3DXPlaneDotCoord(&plane, &vec);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotCoord(NULL,&vec),
got = D3DXPlaneDotCoord(NULL, &vec);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotCoord(NULL,NULL),
got = D3DXPlaneDotCoord(NULL, NULL);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
/*_______________D3DXPlaneDotNormal______________*/
expected = -35.0f;
got = D3DXPlaneDotNormal(&plane,&vec),
got = D3DXPlaneDotNormal(&plane, &vec);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotNormal(NULL,&vec),
got = D3DXPlaneDotNormal(NULL, &vec);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
expected = 0.0f;
got = D3DXPlaneDotNormal(NULL,NULL),
got = D3DXPlaneDotNormal(NULL, NULL);
ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
/*_______________D3DXPlaneFromPointNormal_______*/
......@@ -1463,7 +1463,7 @@ static void D3DXPlaneTest(void)
expectedplane.a = -3.0f/sqrt(26.0f); expectedplane.b = -1.0f/sqrt(26.0f); expectedplane.c = 4.0f/sqrt(26.0f); expectedplane.d = 7.0/sqrt(26.0f);
D3DXPlaneNormalize(&gotplane, &plane);
expect_plane(&expectedplane, &gotplane, 2);
nulplane.a = 0.0; nulplane.b = 0.0f, nulplane.c = 0.0f; nulplane.d = 0.0f;
nulplane.a = 0.0; nulplane.b = 0.0f; nulplane.c = 0.0f; nulplane.d = 0.0f;
expectedplane.a = 0.0f; expectedplane.b = 0.0f; expectedplane.c = 0.0f; expectedplane.d = 0.0f;
D3DXPlaneNormalize(&gotplane, &nulplane);
expect_plane(&expectedplane, &gotplane, 0);
......@@ -1484,9 +1484,9 @@ static void D3DXQuaternionTest(void)
D3DXVECTOR3 axis, expectedvec;
nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f; nul.w = 0.0f;
q.x = 1.0f, q.y = 2.0f; q.z = 4.0f; q.w = 10.0f;
q.x = 1.0f; q.y = 2.0f; q.z = 4.0f; q.w = 10.0f;
r.x = -3.0f; r.y = 4.0f; r.z = -5.0f; r.w = 7.0;
t.x = -1111.0f, t.y = 111.0f; t.z = -11.0f; t.w = 1.0f;
t.x = -1111.0f; t.y = 111.0f; t.z = -11.0f; t.w = 1.0f;
u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f;
smallq.x = 0.1f; smallq.y = 0.2f; smallq.z= 0.3f; smallq.w = 0.4f;
smallr.x = 0.5f; smallr.y = 0.6f; smallr.z= 0.7f; smallr.w = 0.8f;
......@@ -1790,9 +1790,9 @@ static void D3DXQuaternionTest(void)
expect_quaternion(&expectedquat, &gotquat, 2);
/*_______________D3DXQuaternionSquadSetup___________________*/
r.x = 1.0f, r.y = 2.0f; r.z = 4.0f; r.w = 10.0f;
r.x = 1.0f; r.y = 2.0f; r.z = 4.0f; r.w = 10.0f;
s.x = -3.0f; s.y = 4.0f; s.z = -5.0f; s.w = 7.0;
t.x = -1111.0f, t.y = 111.0f; t.z = -11.0f; t.w = 1.0f;
t.x = -1111.0f; t.y = 111.0f; t.z = -11.0f; t.w = 1.0f;
u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f;
D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &t, &u);
expectedquat.x = 7.121285f; expectedquat.y = 2.159964f; expectedquat.z = -3.855094f; expectedquat.w = 5.362844f;
......@@ -2145,7 +2145,7 @@ static void D3DXVector3Test(void)
ok(equal, "Got unexpected length %.8e.\n", got);
/*_______________D3DXVec3Lerp__________________________*/
expectedvec.x = 54.5f; expectedvec.y = 64.5f, expectedvec.z = 41.0f ;
expectedvec.x = 54.5f; expectedvec.y = 64.5f; expectedvec.z = 41.0f ;
D3DXVec3Lerp(&gotvec,&u,&v,scale);
expect_vec3(&expectedvec, &gotvec, 0);
/* Tests the case NULL */
......
......@@ -86,7 +86,7 @@ static void check_floats_(int line, const char *prefix, const float *got, const
equal = equal && compare(*exp, *got);
exp_buffer_ptr += sprintf(exp_buffer_ptr, "%g", *exp);
got_buffer_ptr += sprintf(got_buffer_ptr, "%g", *got);
exp++, got++;
exp++; got++;
}
ok_(__FILE__,line)(equal, "%sExpected (%s), got (%s)", prefix, exp_buffer, got_buffer);
}
......
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