diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index a57b6202cd1..586be2db90b 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -57,6 +57,14 @@ static BOOL compare_vec3(const D3DXVECTOR3 *v1, const D3DXVECTOR3 *v2, unsigned && compare_float(v1->z, v2->z, ulps); } +static BOOL compare_vec4(const D3DXVECTOR4 *v1, const D3DXVECTOR4 *v2, unsigned int ulps) +{ + return compare_float(v1->x, v2->x, ulps) + && compare_float(v1->y, v2->y, ulps) + && compare_float(v1->z, v2->z, ulps) + && compare_float(v1->w, v2->w, ulps); +} + static BOOL compare_color(const D3DXCOLOR *c1, const D3DXCOLOR *c2, unsigned int ulps) { return compare_float(c1->r, c2->r, ulps) @@ -115,6 +123,15 @@ static void expect_vec3_(unsigned int line, const D3DXVECTOR3 *expected, const D vector->x, vector->y, vector->z, expected->x, expected->y, expected->z); } +#define expect_vec4(expected, vector, ulps) expect_vec4_(__LINE__, expected, vector, ulps) +static void expect_vec4_(unsigned int line, const D3DXVECTOR4 *expected, const D3DXVECTOR4 *vector, unsigned int ulps) +{ + BOOL equal = compare_vec4(expected, vector, ulps); + ok_(__FILE__, line)(equal, + "Got unexpected vector {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + vector->x, vector->y, vector->z, vector->w, expected->x, expected->y, expected->z, expected->w); +} + #define expect_color(expected, color, ulps) expect_color_(__LINE__, expected, color, ulps) static void expect_color_(unsigned int line, const D3DXCOLOR *expected, const D3DXCOLOR *color, unsigned int ulps) { @@ -212,9 +229,6 @@ static void expect_matrix_(unsigned int line, const D3DXMATRIX *expected, const i); \ } -#define expect_vec4(expectedvec,gotvec) ok((relative_error(expectedvec.x, gotvec.x)