ReactOS  0.4.15-dev-1177-g6cb3b62
math.c File Reference
#include "wine/test.h"
#include "d3dx9.h"
#include <math.h>
Include dependency graph for math.c:

Go to the source code of this file.

Macros

#define expect_vec2(expected, vector, ulps)   expect_vec2_(__LINE__, expected, vector, ulps)
 
#define expect_vec3(expected, vector, ulps)   expect_vec3_(__LINE__, expected, vector, ulps)
 
#define expect_vec4(expected, vector, ulps)   expect_vec4_(__LINE__, expected, vector, ulps)
 
#define expect_color(expected, color, ulps)   expect_color_(__LINE__, expected, color, ulps)
 
#define expect_plane(expected, plane, ulps)   expect_plane_(__LINE__, expected, plane, ulps)
 
#define expect_quaternion(expected, quaternion, ulps)   expect_quaternion_(__LINE__, expected, quaternion, ulps)
 
#define expect_matrix(expected, matrix, ulps)   expect_matrix_(__LINE__, expected, matrix, ulps)
 
#define expect_vec4_array(count, expected, vector, ulps)   expect_vec4_array_(__LINE__, count, expected, vector, ulps)
 

Functions

static BOOL compare_float (float f, float g, unsigned int ulps)
 
static BOOL compare_vec2 (const D3DXVECTOR2 *v1, const D3DXVECTOR2 *v2, unsigned int ulps)
 
static BOOL compare_vec3 (const D3DXVECTOR3 *v1, const D3DXVECTOR3 *v2, unsigned int ulps)
 
static BOOL compare_vec4 (const D3DXVECTOR4 *v1, const D3DXVECTOR4 *v2, unsigned int ulps)
 
static BOOL compare_color (const D3DXCOLOR *c1, const D3DXCOLOR *c2, unsigned int ulps)
 
static BOOL compare_plane (const D3DXPLANE *p1, const D3DXPLANE *p2, unsigned int ulps)
 
static BOOL compare_quaternion (const D3DXQUATERNION *q1, const D3DXQUATERNION *q2, unsigned int ulps)
 
static BOOL compare_matrix (const D3DXMATRIX *m1, const D3DXMATRIX *m2, unsigned int ulps)
 
static void expect_vec2_ (unsigned int line, const D3DXVECTOR2 *expected, const D3DXVECTOR2 *vector, unsigned int ulps)
 
static void expect_vec3_ (unsigned int line, const D3DXVECTOR3 *expected, const D3DXVECTOR3 *vector, unsigned int ulps)
 
static void expect_vec4_ (unsigned int line, const D3DXVECTOR4 *expected, const D3DXVECTOR4 *vector, unsigned int ulps)
 
static void expect_color_ (unsigned int line, const D3DXCOLOR *expected, const D3DXCOLOR *color, unsigned int ulps)
 
static void expect_plane_ (unsigned int line, const D3DXPLANE *expected, const D3DXPLANE *plane, unsigned int ulps)
 
static void expect_quaternion_ (unsigned int line, const D3DXQUATERNION *expected, const D3DXQUATERNION *quaternion, unsigned int ulps)
 
static void expect_matrix_ (unsigned int line, const D3DXMATRIX *expected, const D3DXMATRIX *matrix, unsigned int ulps)
 
static void expect_vec4_array_ (unsigned int line, unsigned int count, const D3DXVECTOR4 *expected, const D3DXVECTOR4 *vector, unsigned int ulps)
 
static void set_matrix (D3DXMATRIX *mat, float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
 
static void D3DXColorTest (void)
 
static void D3DXFresnelTest (void)
 
static void D3DXMatrixTest (void)
 
static void D3DXPlaneTest (void)
 
static void D3DXQuaternionTest (void)
 
static void D3DXVector2Test (void)
 
static void D3DXVector3Test (void)
 
static void D3DXVector4Test (void)
 
static void test_matrix_stack (void)
 
static void test_Matrix_AffineTransformation2D (void)
 
static void test_Matrix_Decompose (void)
 
static void test_Matrix_Transformation2D (void)
 
static void test_D3DXVec_Array (void)
 
static void test_D3DXFloat_Array (void)
 
static void test_D3DXSHAdd (void)
 
static void test_D3DXSHDot (void)
 
static void test_D3DXSHEvalConeLight (void)
 
static void test_D3DXSHEvalDirection (void)
 
static void test_D3DXSHEvalDirectionalLight (void)
 
static void test_D3DXSHEvalHemisphereLight (void)
 
static void test_D3DXSHEvalSphericalLight (void)
 
static void test_D3DXSHMultiply2 (void)
 
static void test_D3DXSHMultiply3 (void)
 
static void test_D3DXSHMultiply4 (void)
 
static void test_D3DXSHRotate (void)
 
static void test_D3DXSHRotateZ (void)
 
static void test_D3DXSHScale (void)
 
 START_TEST (math)
 

Macro Definition Documentation

◆ expect_color

#define expect_color (   expected,
  color,
  ulps 
)    expect_color_(__LINE__, expected, color, ulps)

Definition at line 129 of file math.c.

◆ expect_matrix

#define expect_matrix (   expected,
  matrix,
  ulps 
)    expect_matrix_(__LINE__, expected, matrix, ulps)

Definition at line 158 of file math.c.

◆ expect_plane

#define expect_plane (   expected,
  plane,
  ulps 
)    expect_plane_(__LINE__, expected, plane, ulps)

Definition at line 138 of file math.c.

◆ expect_quaternion

#define expect_quaternion (   expected,
  quaternion,
  ulps 
)    expect_quaternion_(__LINE__, expected, quaternion, ulps)

Definition at line 147 of file math.c.

◆ expect_vec2

#define expect_vec2 (   expected,
  vector,
  ulps 
)    expect_vec2_(__LINE__, expected, vector, ulps)

Definition at line 102 of file math.c.

◆ expect_vec3

#define expect_vec3 (   expected,
  vector,
  ulps 
)    expect_vec3_(__LINE__, expected, vector, ulps)

Definition at line 111 of file math.c.

◆ expect_vec4

#define expect_vec4 (   expected,
  vector,
  ulps 
)    expect_vec4_(__LINE__, expected, vector, ulps)

Definition at line 120 of file math.c.

◆ expect_vec4_array

#define expect_vec4_array (   count,
  expected,
  vector,
  ulps 
)    expect_vec4_array_(__LINE__, count, expected, vector, ulps)

Definition at line 177 of file math.c.

Function Documentation

◆ compare_color()

static BOOL compare_color ( const D3DXCOLOR c1,
const D3DXCOLOR c2,
unsigned int  ulps 
)
static

Definition at line 62 of file math.c.

63 {
64  return compare_float(c1->r, c2->r, ulps)
65  && compare_float(c1->g, c2->g, ulps)
66  && compare_float(c1->b, c2->b, ulps)
67  && compare_float(c1->a, c2->a, ulps);
68 }
FLOAT g
Definition: d3dx9math.h:262
FLOAT a
Definition: d3dx9math.h:262
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
FLOAT r
Definition: d3dx9math.h:262
FLOAT b
Definition: d3dx9math.h:262
unsigned int ulps
Definition: effect.c:4351

Referenced by expect_color_().

◆ compare_float()

static BOOL compare_float ( float  f,
float  g,
unsigned int  ulps 
)
static

Definition at line 26 of file math.c.

27 {
28  int x = *(int *)&f;
29  int y = *(int *)&g;
30 
31  if (x < 0)
32  x = INT_MIN - x;
33  if (y < 0)
34  y = INT_MIN - y;
35 
36  if (abs(x - y) > ulps)
37  return FALSE;
38 
39  return TRUE;
40 }
#define abs(i)
Definition: fconv.c:206
#define TRUE
Definition: types.h:120
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FALSE
Definition: types.h:117
GLboolean GLboolean g
Definition: glext.h:6204
GLfloat f
Definition: glext.h:7540
#define INT_MIN
Definition: limits.h:39
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ulps
Definition: effect.c:4351

Referenced by compare_color(), compare_matrix(), compare_plane(), compare_quaternion(), compare_vec2(), compare_vec3(), compare_vec4(), D3DXFresnelTest(), D3DXMatrixTest(), D3DXQuaternionTest(), D3DXVector2Test(), D3DXVector3Test(), D3DXVector4Test(), test_D3DXFloat_Array(), test_D3DXSHAdd(), test_D3DXSHDot(), test_D3DXSHEvalConeLight(), test_D3DXSHEvalDirection(), test_D3DXSHEvalDirectionalLight(), test_D3DXSHEvalHemisphereLight(), test_D3DXSHEvalSphericalLight(), test_D3DXSHMultiply2(), test_D3DXSHMultiply3(), test_D3DXSHMultiply4(), test_D3DXSHRotate(), test_D3DXSHRotateZ(), and test_D3DXSHScale().

◆ compare_matrix()

static BOOL compare_matrix ( const D3DXMATRIX m1,
const D3DXMATRIX m2,
unsigned int  ulps 
)
static

Definition at line 86 of file math.c.

87 {
88  unsigned int i, j;
89 
90  for (i = 0; i < 4; ++i)
91  {
92  for (j = 0; j < 4; ++j)
93  {
94  if (!compare_float(U(*m1).m[i][j], U(*m2).m[i][j], ulps))
95  return FALSE;
96  }
97  }
98 
99  return TRUE;
100 }
#define TRUE
Definition: types.h:120
#define U(x)
Definition: wordpad.c:45
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int ulps
Definition: effect.c:4351

Referenced by expect_matrix_().

◆ compare_plane()

static BOOL compare_plane ( const D3DXPLANE p1,
const D3DXPLANE p2,
unsigned int  ulps 
)
static

Definition at line 70 of file math.c.

71 {
72  return compare_float(p1->a, p2->a, ulps)
73  && compare_float(p1->b, p2->b, ulps)
74  && compare_float(p1->c, p2->c, ulps)
75  && compare_float(p1->d, p2->d, ulps);
76 }
FLOAT d
Definition: d3dx9math.h:221
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
FLOAT c
Definition: d3dx9math.h:221
FLOAT b
Definition: d3dx9math.h:221
unsigned int ulps
Definition: effect.c:4351
FLOAT a
Definition: d3dx9math.h:221

Referenced by expect_plane_(), and test_D3DXVec_Array().

◆ compare_quaternion()

static BOOL compare_quaternion ( const D3DXQUATERNION q1,
const D3DXQUATERNION q2,
unsigned int  ulps 
)
static

Definition at line 78 of file math.c.

79 {
80  return compare_float(q1->x, q2->x, ulps)
81  && compare_float(q1->y, q2->y, ulps)
82  && compare_float(q1->z, q2->z, ulps)
83  && compare_float(q1->w, q2->w, ulps);
84 }
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
unsigned int ulps
Definition: effect.c:4351

Referenced by expect_quaternion_(), and test_Matrix_Decompose().

◆ compare_vec2()

static BOOL compare_vec2 ( const D3DXVECTOR2 v1,
const D3DXVECTOR2 v2,
unsigned int  ulps 
)
static

Definition at line 42 of file math.c.

43 {
44  return compare_float(v1->x, v2->x, ulps) && compare_float(v1->y, v2->y, ulps);
45 }
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
unsigned int ulps
Definition: effect.c:4351
GLfloat GLfloat v1
Definition: glext.h:6062

Referenced by expect_vec2_().

◆ compare_vec3()

static BOOL compare_vec3 ( const D3DXVECTOR3 v1,
const D3DXVECTOR3 v2,
unsigned int  ulps 
)
static

Definition at line 47 of file math.c.

48 {
49  return compare_float(v1->x, v2->x, ulps)
50  && compare_float(v1->y, v2->y, ulps)
51  && compare_float(v1->z, v2->z, ulps);
52 }
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
unsigned int ulps
Definition: effect.c:4351
GLfloat GLfloat v1
Definition: glext.h:6062

Referenced by expect_vec3_().

◆ compare_vec4()

static BOOL compare_vec4 ( const D3DXVECTOR4 v1,
const D3DXVECTOR4 v2,
unsigned int  ulps 
)
static

Definition at line 54 of file math.c.

55 {
56  return compare_float(v1->x, v2->x, ulps)
57  && compare_float(v1->y, v2->y, ulps)
58  && compare_float(v1->z, v2->z, ulps)
59  && compare_float(v1->w, v2->w, ulps);
60 }
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
unsigned int ulps
Definition: effect.c:4351
GLfloat GLfloat v1
Definition: glext.h:6062

Referenced by expect_vec4_(), and expect_vec4_array_().

◆ D3DXColorTest()

static void D3DXColorTest ( void  )
static

Definition at line 208 of file math.c.

209 {
210  D3DXCOLOR color, color1, color2, expected, got;
211  LPD3DXCOLOR funcpointer;
212  FLOAT scale;
213 
214  color.r = 0.2f; color.g = 0.75f; color.b = 0.41f; color.a = 0.93f;
215  color1.r = 0.6f; color1.g = 0.55f; color1.b = 0.23f; color1.a = 0.82f;
216  color2.r = 0.3f; color2.g = 0.5f; color2.b = 0.76f; color2.a = 0.11f;
217 
218  scale = 0.3f;
219 
220 /*_______________D3DXColorAdd________________*/
221  expected.r = 0.9f; expected.g = 1.05f; expected.b = 0.99f, expected.a = 0.93f;
222  D3DXColorAdd(&got,&color1,&color2);
223  expect_color(&expected, &got, 1);
224  /* Test the NULL case */
225  funcpointer = D3DXColorAdd(&got,NULL,&color2);
226  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
227  funcpointer = D3DXColorAdd(NULL,NULL,&color2);
228  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
229  funcpointer = D3DXColorAdd(NULL,NULL,NULL);
230  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
231 
232 /*_______________D3DXColorAdjustContrast______*/
233  expected.r = 0.41f; expected.g = 0.575f; expected.b = 0.473f, expected.a = 0.93f;
235  expect_color(&expected, &got, 0);
236 
237 /*_______________D3DXColorAdjustSaturation______*/
238  expected.r = 0.486028f; expected.g = 0.651028f; expected.b = 0.549028f, expected.a = 0.93f;
240  expect_color(&expected, &got, 16);
241 
242 /*_______________D3DXColorLerp________________*/
243  expected.r = 0.32f; expected.g = 0.69f; expected.b = 0.356f; expected.a = 0.897f;
244  D3DXColorLerp(&got,&color,&color1,scale);
245  expect_color(&expected, &got, 0);
246  /* Test the NULL case */
247  funcpointer = D3DXColorLerp(&got,NULL,&color1,scale);
248  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
249  funcpointer = D3DXColorLerp(NULL,NULL,&color1,scale);
250  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
251  funcpointer = D3DXColorLerp(NULL,NULL,NULL,scale);
252  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
253 
254 /*_______________D3DXColorModulate________________*/
255  expected.r = 0.18f; expected.g = 0.275f; expected.b = 0.1748f; expected.a = 0.0902f;
256  D3DXColorModulate(&got,&color1,&color2);
257  expect_color(&expected, &got, 0);
258  /* Test the NULL case */
259  funcpointer = D3DXColorModulate(&got,NULL,&color2);
260  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
261  funcpointer = D3DXColorModulate(NULL,NULL,&color2);
262  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
263  funcpointer = D3DXColorModulate(NULL,NULL,NULL);
264  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
265 
266 /*_______________D3DXColorNegative________________*/
267  expected.r = 0.8f; expected.g = 0.25f; expected.b = 0.59f; expected.a = 0.93f;
268  D3DXColorNegative(&got,&color);
269  expect_color(&expected, &got, 1);
270  /* Test the greater than 1 case */
271  color1.r = 0.2f; color1.g = 1.75f; color1.b = 0.41f; color1.a = 0.93f;
272  expected.r = 0.8f; expected.g = -0.75f; expected.b = 0.59f; expected.a = 0.93f;
273  D3DXColorNegative(&got,&color1);
274  expect_color(&expected, &got, 1);
275  /* Test the negative case */
276  color1.r = 0.2f; color1.g = -0.75f; color1.b = 0.41f; color1.a = 0.93f;
277  expected.r = 0.8f; expected.g = 1.75f; expected.b = 0.59f; expected.a = 0.93f;
278  D3DXColorNegative(&got,&color1);
279  expect_color(&expected, &got, 1);
280  /* Test the NULL case */
281  funcpointer = D3DXColorNegative(&got,NULL);
282  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
283  funcpointer = D3DXColorNegative(NULL,NULL);
284  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
285 
286 /*_______________D3DXColorScale________________*/
287  expected.r = 0.06f; expected.g = 0.225f; expected.b = 0.123f; expected.a = 0.279f;
288  D3DXColorScale(&got,&color,scale);
289  expect_color(&expected, &got, 1);
290  /* Test the NULL case */
291  funcpointer = D3DXColorScale(&got,NULL,scale);
292  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
293  funcpointer = D3DXColorScale(NULL,NULL,scale);
294  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
295 
296 /*_______________D3DXColorSubtract_______________*/
297  expected.r = -0.1f; expected.g = 0.25f; expected.b = -0.35f, expected.a = 0.82f;
298  D3DXColorSubtract(&got,&color,&color2);
299  expect_color(&expected, &got, 1);
300  /* Test the NULL case */
301  funcpointer = D3DXColorSubtract(&got,NULL,&color2);
302  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
303  funcpointer = D3DXColorSubtract(NULL,NULL,&color2);
304  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
305  funcpointer = D3DXColorSubtract(NULL,NULL,NULL);
306  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
307 }
#define expect_color(expected, color, ulps)
Definition: math.c:129
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
FLOAT g
Definition: d3dx9math.h:262
FLOAT a
Definition: d3dx9math.h:262
FLOAT r
Definition: d3dx9math.h:262
GLuint color
Definition: glext.h:6243
smooth NULL
Definition: ftsmooth.c:416
D3DXCOLOR *WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, const D3DXCOLOR *pc, FLOAT s)
Definition: math.c:46
FLOAT b
Definition: d3dx9math.h:262
D3DXCOLOR *WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, const D3DXCOLOR *pc, FLOAT s)
Definition: math.c:57
#define ok(value,...)
Definition: atltest.h:57
float FLOAT
Definition: typedefs.h:69
BOOL expected
Definition: store.c:2063

Referenced by START_TEST().

◆ D3DXFresnelTest()

static void D3DXFresnelTest ( void  )
static

Definition at line 309 of file math.c.

310 {
311  float fresnel;
312  BOOL equal;
313 
314  fresnel = D3DXFresnelTerm(0.5f, 1.5f);
315  equal = compare_float(fresnel, 8.91867128e-02f, 1);
316  ok(equal, "Got unexpected Fresnel term %.8e.\n", fresnel);
317 }
#define equal(x, y)
Definition: reader.cc:56
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
unsigned int BOOL
Definition: ntddk_ex.h:94
#define e
Definition: ke_i.h:82
GLfloat f
Definition: glext.h:7540
#define ok(value,...)
Definition: atltest.h:57
FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex)
Definition: math.c:73

Referenced by START_TEST().

◆ D3DXMatrixTest()

static void D3DXMatrixTest ( void  )
static

Definition at line 319 of file math.c.

320 {
321  D3DXMATRIX expectedmat, gotmat, mat, mat2, mat3;
322  BOOL expected, got, equal;
323  float angle, determinant;
324  D3DXMATRIX *funcpointer;
326  D3DXQUATERNION q, r;
327  D3DXVECTOR3 at, axis, eye, last;
329 
330  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
331  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
332  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
333  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
334  U(mat).m[0][0] = 10.0f; U(mat).m[1][1] = 20.0f; U(mat).m[2][2] = 30.0f;
335  U(mat).m[3][3] = -40.0f;
336 
337  U(mat2).m[0][0] = 1.0f; U(mat2).m[1][0] = 2.0f; U(mat2).m[2][0] = 3.0f;
338  U(mat2).m[3][0] = 4.0f; U(mat2).m[0][1] = 5.0f; U(mat2).m[1][1] = 6.0f;
339  U(mat2).m[2][1] = 7.0f; U(mat2).m[3][1] = 8.0f; U(mat2).m[0][2] = -8.0f;
340  U(mat2).m[1][2] = -7.0f; U(mat2).m[2][2] = -6.0f; U(mat2).m[3][2] = -5.0f;
341  U(mat2).m[0][3] = -4.0f; U(mat2).m[1][3] = -3.0f; U(mat2).m[2][3] = -2.0f;
342  U(mat2).m[3][3] = -1.0f;
343 
344  plane.a = -3.0f; plane.b = -1.0f; plane.c = 4.0f; plane.d = 7.0f;
345 
346  q.x = 1.0f; q.y = -4.0f; q.z =7.0f; q.w = -11.0f;
347  r.x = 0.87f; r.y = 0.65f; r.z =0.43f; r.w= 0.21f;
348 
349  at.x = -2.0f; at.y = 13.0f; at.z = -9.0f;
350  axis.x = 1.0f; axis.y = -3.0f; axis.z = 7.0f;
351  eye.x = 8.0f; eye.y = -5.0f; eye.z = 5.75f;
352  last.x = 9.7f; last.y = -8.6; last.z = 1.3f;
353 
354  light.x = 9.6f; light.y = 8.5f; light.z = 7.4; light.w = 6.3;
355 
356  angle = D3DX_PI/3.0f;
357 
358 /*____________D3DXMatrixAffineTransformation______*/
359  set_matrix(&expectedmat,
360  -459.239990f, -576.719971f, -263.440002f, 0.0f,
361  519.760010f, -352.440002f, -277.679993f, 0.0f,
362  363.119995f, -121.040001f, -117.479996f, 0.0f,
363  -1239.0f, 667.0f, 567.0f, 1.0f);
364  D3DXMatrixAffineTransformation(&gotmat, 3.56f, &at, &q, &axis);
365  expect_matrix(&expectedmat, &gotmat, 0);
366 
367  /* Test the NULL case */
368  U(expectedmat).m[3][0] = 1.0f; U(expectedmat).m[3][1] = -3.0f; U(expectedmat).m[3][2] = 7.0f; U(expectedmat).m[3][3] = 1.0f;
369  D3DXMatrixAffineTransformation(&gotmat, 3.56f, NULL, &q, &axis);
370  expect_matrix(&expectedmat, &gotmat, 0);
371 
372  U(expectedmat).m[3][0] = -1240.0f; U(expectedmat).m[3][1] = 670.0f; U(expectedmat).m[3][2] = 560.0f; U(expectedmat).m[3][3] = 1.0f;
373  D3DXMatrixAffineTransformation(&gotmat, 3.56f, &at, &q, NULL);
374  expect_matrix(&expectedmat, &gotmat, 0);
375 
376  U(expectedmat).m[3][0] = 0.0f; U(expectedmat).m[3][1] = 0.0f; U(expectedmat).m[3][2] = 0.0f; U(expectedmat).m[3][3] = 1.0f;
377  D3DXMatrixAffineTransformation(&gotmat, 3.56f, NULL, &q, NULL);
378  expect_matrix(&expectedmat, &gotmat, 0);
379 
380  set_matrix(&expectedmat,
381  3.56f, 0.0f, 0.0f, 0.0f,
382  0.0f, 3.56f, 0.0f, 0.0f,
383  0.0f, 0.0f, 3.56f, 0.0f,
384  1.0f, -3.0f, 7.0f, 1.0f);
385  D3DXMatrixAffineTransformation(&gotmat, 3.56f, NULL, NULL, &axis);
386  expect_matrix(&expectedmat, &gotmat, 0);
387 
388  D3DXMatrixAffineTransformation(&gotmat, 3.56f, &at, NULL, &axis);
389  expect_matrix(&expectedmat, &gotmat, 0);
390 
391  U(expectedmat).m[3][0] = 0.0f; U(expectedmat).m[3][1] = 0.0f; U(expectedmat).m[3][2] = 0.0f; U(expectedmat).m[3][3] = 1.0f;
392  D3DXMatrixAffineTransformation(&gotmat, 3.56f, &at, NULL, NULL);
393  expect_matrix(&expectedmat, &gotmat, 0);
394 
395  D3DXMatrixAffineTransformation(&gotmat, 3.56f, NULL, NULL, NULL);
396  expect_matrix(&expectedmat, &gotmat, 0);
397 
398 /*____________D3DXMatrixfDeterminant_____________*/
399  determinant = D3DXMatrixDeterminant(&mat);
400  equal = compare_float(determinant, -147888.0f, 0);
401  ok(equal, "Got unexpected determinant %.8e.\n", determinant);
402 
403 /*____________D3DXMatrixInverse______________*/
404  set_matrix(&expectedmat,
405  16067.0f/73944.0f, -10165.0f/147888.0f, -2729.0f/147888.0f, -1631.0f/49296.0f,
406  -565.0f/36972.0f, 2723.0f/73944.0f, -1073.0f/73944.0f, 289.0f/24648.0f,
407  -389.0f/2054.0f, 337.0f/4108.0f, 181.0f/4108.0f, 317.0f/4108.0f,
408  163.0f/5688.0f, -101.0f/11376.0f, -73.0f/11376.0f, -127.0f/3792.0f);
409  D3DXMatrixInverse(&gotmat, &determinant, &mat);
410  expect_matrix(&expectedmat, &gotmat, 1);
411  equal = compare_float(determinant, -147888.0f, 0);
412  ok(equal, "Got unexpected determinant %.8e.\n", determinant);
413  funcpointer = D3DXMatrixInverse(&gotmat,NULL,&mat2);
414  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
415 
416 /*____________D3DXMatrixIsIdentity______________*/
417  expected = FALSE;
418  memset(&mat3, 0, sizeof(mat3));
419  got = D3DXMatrixIsIdentity(&mat3);
420  ok(expected == got, "Expected : %d, Got : %d\n", expected, got);
421  D3DXMatrixIdentity(&mat3);
422  expected = TRUE;
423  got = D3DXMatrixIsIdentity(&mat3);
424  ok(expected == got, "Expected : %d, Got : %d\n", expected, got);
425  U(mat3).m[0][0] = 0.000009f;
426  expected = FALSE;
427  got = D3DXMatrixIsIdentity(&mat3);
428  ok(expected == got, "Expected : %d, Got : %d\n", expected, got);
429  /* Test the NULL case */
430  expected = FALSE;
431  got = D3DXMatrixIsIdentity(NULL);
432  ok(expected == got, "Expected : %d, Got : %d\n", expected, got);
433 
434 /*____________D3DXMatrixLookAtLH_______________*/
435  set_matrix(&expectedmat,
436  -0.82246518f, -0.40948939f, -0.39480308f, 0.0f,
437  -0.55585691f, 0.43128574f, 0.71064550f, 0.0f,
438  -0.12072885f, 0.80393475f, -0.58233452f, 0.0f,
439  4.4946337f, 0.80971903f, 10.060076f, 1.0f);
440  D3DXMatrixLookAtLH(&gotmat, &eye, &at, &axis);
441  expect_matrix(&expectedmat, &gotmat, 32);
442 
443 /*____________D3DXMatrixLookAtRH_______________*/
444  set_matrix(&expectedmat,
445  0.82246518f, -0.40948939f, 0.39480308f, 0.0f,
446  0.55585691f, 0.43128574f, -0.71064550f, 0.0f,
447  0.12072885f, 0.80393475f, 0.58233452f, 0.0f,
448  -4.4946337f, 0.80971903f, -10.060076f, 1.0f);
449  D3DXMatrixLookAtRH(&gotmat, &eye, &at, &axis);
450  expect_matrix(&expectedmat, &gotmat, 32);
451 
452 /*____________D3DXMatrixMultiply______________*/
453  set_matrix(&expectedmat,
454  73.0f, 193.0f, -197.0f, -77.0f,
455  231.0f, 551.0f, -489.0f, -169.0f,
456  239.0f, 523.0f, -400.0f, -116.0f,
457  -164.0f, -320.0f, 187.0f, 31.0f);
458  D3DXMatrixMultiply(&gotmat, &mat, &mat2);
459  expect_matrix(&expectedmat, &gotmat, 0);
460 
461 /*____________D3DXMatrixMultiplyTranspose____*/
462  set_matrix(&expectedmat,
463  73.0f, 231.0f, 239.0f, -164.0f,
464  193.0f, 551.0f, 523.0f, -320.0f,
465  -197.0f, -489.0f, -400.0f, 187.0f,
466  -77.0f, -169.0f, -116.0f, 31.0f);
467  D3DXMatrixMultiplyTranspose(&gotmat, &mat, &mat2);
468  expect_matrix(&expectedmat, &gotmat, 0);
469 
470 /*____________D3DXMatrixOrthoLH_______________*/
471  set_matrix(&expectedmat,
472  0.8f, 0.0f, 0.0f, 0.0f,
473  0.0f, 0.27027027f, 0.0f, 0.0f,
474  0.0f, 0.0f, -0.15151515f, 0.0f,
475  0.0f, 0.0f, -0.48484848f, 1.0f);
476  D3DXMatrixOrthoLH(&gotmat, 2.5f, 7.4f, -3.2f, -9.8f);
477  expect_matrix(&expectedmat, &gotmat, 16);
478 
479 /*____________D3DXMatrixOrthoOffCenterLH_______________*/
480  set_matrix(&expectedmat,
481  3.6363636f, 0.0f, 0.0f, 0.0f,
482  0.0f, 0.18018018f, 0.0f, 0.0f,
483  0.0f, 0.0f, -0.045662100f, 0.0f,
484  -1.7272727f, -0.56756757f, 0.42465753f, 1.0f);
485  D3DXMatrixOrthoOffCenterLH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f, 9.3, -12.6);
486  expect_matrix(&expectedmat, &gotmat, 32);
487 
488 /*____________D3DXMatrixOrthoOffCenterRH_______________*/
489  set_matrix(&expectedmat,
490  3.6363636f, 0.0f, 0.0f, 0.0f,
491  0.0f, 0.18018018f, 0.0f, 0.0f,
492  0.0f, 0.0f, 0.045662100f, 0.0f,
493  -1.7272727f, -0.56756757f, 0.42465753f, 1.0f);
494  D3DXMatrixOrthoOffCenterRH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f, 9.3, -12.6);
495  expect_matrix(&expectedmat, &gotmat, 32);
496 
497 /*____________D3DXMatrixOrthoRH_______________*/
498  set_matrix(&expectedmat,
499  0.8f, 0.0f, 0.0f, 0.0f,
500  0.0f, 0.27027027f, 0.0f, 0.0f,
501  0.0f, 0.0f, 0.15151515f, 0.0f,
502  0.0f, 0.0f, -0.48484848f, 1.0f);
503  D3DXMatrixOrthoRH(&gotmat, 2.5f, 7.4f, -3.2f, -9.8f);
504  expect_matrix(&expectedmat, &gotmat, 16);
505 
506 /*____________D3DXMatrixPerspectiveFovLH_______________*/
507  set_matrix(&expectedmat,
508  13.288858f, 0.0f, 0.0f, 0.0f,
509  0.0f, 9.9666444f, 0.0f, 0.0f,
510  0.0f, 0.0f, 0.78378378f, 1.0f,
511  0.0f, 0.0f, 1.8810811f, 0.0f);
512  D3DXMatrixPerspectiveFovLH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f);
513  expect_matrix(&expectedmat, &gotmat, 4);
514 
515 /*____________D3DXMatrixPerspectiveFovRH_______________*/
516  set_matrix(&expectedmat,
517  13.288858f, 0.0f, 0.0f, 0.0f,
518  0.0f, 9.9666444f, 0.0f, 0.0f,
519  0.0f, 0.0f, -0.78378378f, -1.0f,
520  0.0f, 0.0f, 1.8810811f, 0.0f);
521  D3DXMatrixPerspectiveFovRH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f);
522  expect_matrix(&expectedmat, &gotmat, 4);
523 
524 /*____________D3DXMatrixPerspectiveLH_______________*/
525  set_matrix(&expectedmat,
526  -24.0f, 0.0f, 0.0f, 0.0f,
527  0.0f, -6.4f, 0.0f, 0.0f,
528  0.0f, 0.0f, 0.78378378f, 1.0f,
529  0.0f, 0.0f, 1.8810811f, 0.0f);
530  D3DXMatrixPerspectiveLH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f);
531  expect_matrix(&expectedmat, &gotmat, 4);
532 
533 /*____________D3DXMatrixPerspectiveOffCenterLH_______________*/
534  set_matrix(&expectedmat,
535  11.636364f, 0.0f, 0.0f, 0.0f,
536  0.0f, 0.57657658f, 0.0f, 0.0f,
537  -1.7272727f, -0.56756757f, 0.84079602f, 1.0f,
538  0.0f, 0.0f, -2.6905473f, 0.0f);
539  D3DXMatrixPerspectiveOffCenterLH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f, 3.2f, -16.9f);
540  expect_matrix(&expectedmat, &gotmat, 8);
541 
542 /*____________D3DXMatrixPerspectiveOffCenterRH_______________*/
543  set_matrix(&expectedmat,
544  11.636364f, 0.0f, 0.0f, 0.0f,
545  0.0f, 0.57657658f, 0.0f, 0.0f,
546  1.7272727f, 0.56756757f, -0.84079602f, -1.0f,
547  0.0f, 0.0f, -2.6905473f, 0.0f);
548  D3DXMatrixPerspectiveOffCenterRH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f, 3.2f, -16.9f);
549  expect_matrix(&expectedmat, &gotmat, 8);
550 
551 /*____________D3DXMatrixPerspectiveRH_______________*/
552  set_matrix(&expectedmat,
553  -24.0f, -0.0f, 0.0f, 0.0f,
554  0.0f, -6.4f, 0.0f, 0.0f,
555  0.0f, 0.0f, -0.78378378f, -1.0f,
556  0.0f, 0.0f, 1.8810811f, 0.0f);
557  D3DXMatrixPerspectiveRH(&gotmat, 0.2f, 0.75f, -2.4f, 8.7f);
558  expect_matrix(&expectedmat, &gotmat, 4);
559 
560 /*____________D3DXMatrixReflect______________*/
561  set_matrix(&expectedmat,
562  0.30769235f, -0.23076922f, 0.92307687f, 0.0f,
563  -0.23076922, 0.92307693f, 0.30769232f, 0.0f,
564  0.92307687f, 0.30769232f, -0.23076922f, 0.0f,
565  1.6153846f, 0.53846157f, -2.1538463f, 1.0f);
566  D3DXMatrixReflect(&gotmat, &plane);
567  expect_matrix(&expectedmat, &gotmat, 32);
568 
569 /*____________D3DXMatrixRotationAxis_____*/
570  set_matrix(&expectedmat,
571  0.50847453f, 0.76380461f, 0.39756277f, 0.0f,
572  -0.81465209f, 0.57627118f, -0.065219201f, 0.0f,
573  -0.27891868f, -0.29071301f, 0.91525424f, 0.0f,
574  0.0f, 0.0f, 0.0f, 1.0f);
575  D3DXMatrixRotationAxis(&gotmat, &axis, angle);
576  expect_matrix(&expectedmat, &gotmat, 32);
577 
578 /*____________D3DXMatrixRotationQuaternion______________*/
579  set_matrix(&expectedmat,
580  -129.0f, -162.0f, -74.0f, 0.0f,
581  146.0f, -99.0f, -78.0f, 0.0f,
582  102.0f, -34.0f, -33.0f, 0.0f,
583  0.0f, 0.0f, 0.0f, 1.0f);
584  D3DXMatrixRotationQuaternion(&gotmat, &q);
585  expect_matrix(&expectedmat, &gotmat, 0);
586 
587 /*____________D3DXMatrixRotationX______________*/
588  set_matrix(&expectedmat,
589  1.0f, 0.0f, 0.0f, 0.0f,
590  0.0f, 0.5f, sqrt(3.0f)/2.0f, 0.0f,
591  0.0f, -sqrt(3.0f)/2.0f, 0.5f, 0.0f,
592  0.0f, 0.0f, 0.0f, 1.0f);
593  D3DXMatrixRotationX(&gotmat, angle);
594  expect_matrix(&expectedmat, &gotmat, 1);
595 
596 /*____________D3DXMatrixRotationY______________*/
597  set_matrix(&expectedmat,
598  0.5f, 0.0f, -sqrt(3.0f)/2.0f, 0.0f,
599  0.0f, 1.0f, 0.0f, 0.0f,
600  sqrt(3.0f)/2.0f, 0.0f, 0.5f, 0.0f,
601  0.0f, 0.0f, 0.0f, 1.0f);
602  D3DXMatrixRotationY(&gotmat, angle);
603  expect_matrix(&expectedmat, &gotmat, 1);
604 
605 /*____________D3DXMatrixRotationYawPitchRoll____*/
606  set_matrix(&expectedmat,
607  0.88877726f, 0.091874748f, -0.44903678f, 0.0f,
608  0.35171318f, 0.49148652f, 0.79670501f, 0.0f,
609  0.29389259f, -0.86602545f, 0.40450847f, 0.0f,
610  0.0f, 0.0f, 0.0f, 1.0f);
611  D3DXMatrixRotationYawPitchRoll(&gotmat, 3.0f * angle / 5.0f, angle, 3.0f * angle / 17.0f);
612  expect_matrix(&expectedmat, &gotmat, 64);
613 
614 /*____________D3DXMatrixRotationZ______________*/
615  set_matrix(&expectedmat,
616  0.5f, sqrt(3.0f)/2.0f, 0.0f, 0.0f,
617  -sqrt(3.0f)/2.0f, 0.5f, 0.0f, 0.0f,
618  0.0f, 0.0f, 1.0f, 0.0f,
619  0.0f, 0.0f, 0.0f, 1.0f);
620  D3DXMatrixRotationZ(&gotmat, angle);
621  expect_matrix(&expectedmat, &gotmat, 1);
622 
623 /*____________D3DXMatrixScaling______________*/
624  set_matrix(&expectedmat,
625  0.69f, 0.0f, 0.0f, 0.0f,
626  0.0f, 0.53f, 0.0f, 0.0f,
627  0.0f, 0.0f, 4.11f, 0.0f,
628  0.0f, 0.0f, 0.0f, 1.0f);
629  D3DXMatrixScaling(&gotmat, 0.69f, 0.53f, 4.11f);
630  expect_matrix(&expectedmat, &gotmat, 0);
631 
632 /*____________D3DXMatrixShadow______________*/
633  set_matrix(&expectedmat,
634  12.786773f, 5.0009613f, 4.3537784f, 3.7065949f,
635  1.8827150f, 8.8056154f, 1.4512594f, 1.2355317f,
636  -7.5308599f, -6.6679487f, 1.3335901f, -4.9421268f,
637  -13.179006f, -11.668910f, -10.158816f, -1.5100943f);
638  D3DXMatrixShadow(&gotmat, &light, &plane);
639  expect_matrix(&expectedmat, &gotmat, 8);
640 
641 /*____________D3DXMatrixTransformation______________*/
642  set_matrix(&expectedmat,
643  1.0f, 0.0f, 0.0f, 0.0f,
644  0.0f, 1.0f, 0.0f, 0.0f,
645  0.0f, 0.0f, 1.0f, 0.0f,
646  0.0f, 0.0f, 0.0f, 1.0f);
648  expect_matrix(&expectedmat, &gotmat, 0);
649 
650  set_matrix(&expectedmat,
651  1.0f, 0.0f, 0.0f, 0.0f,
652  0.0f, 1.0f, 0.0f, 0.0f,
653  0.0f, 0.0f, 1.0f, 0.0f,
654  9.7f, -8.6f, 1.3f, 1.0f);
656  expect_matrix(&expectedmat, &gotmat, 0);
657 
658  set_matrix(&expectedmat,
659  -0.2148f, 1.3116f, 0.4752f, 0.0f,
660  0.9504f, -0.8836f, 0.9244f, 0.0f,
661  1.0212f, 0.1936f, -1.3588f, 0.0f,
662  0.0f, 0.0f, 0.0f, 1.0f);
663  D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, NULL, &r, NULL);
664  expect_matrix(&expectedmat, &gotmat, 8);
665 
666  set_matrix(&expectedmat,
667  1.0f, 0.0f, 0.0f, 0.0f,
668  0.0f, 1.0f, 0.0f, 0.0f,
669  0.0f, 0.0f, 1.0f, 0.0f,
670  0.0f, 0.0f, 0.0f, 1.0f);
671  D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, NULL, NULL);
672  expect_matrix(&expectedmat, &gotmat, 0);
673 
674  set_matrix(&expectedmat,
675  1.0f, 0.0f, 0.0f, 0.0f,
676  0.0f, -3.0f, 0.0f, 0.0f,
677  0.0f, 0.0f, 7.0f, 0.0f,
678  0.0f, 0.0f, 0.0f, 1.0f);
679  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, NULL, NULL);
680  expect_matrix(&expectedmat, &gotmat, 0);
681 
682  set_matrix(&expectedmat,
683  1.0f, 0.0f, 0.0f, 0.0f,
684  0.0f, 1.0f, 0.0f, 0.0f,
685  0.0f, 0.0f, 1.0f, 0.0f,
686  0.0f, 0.0f, 0.0f, 1.0f);
687  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, NULL, NULL);
688  expect_matrix(&expectedmat, &gotmat, 0);
689 
690  set_matrix(&expectedmat,
691  1.0f, 0.0f, 0.0f, 0.0f,
692  0.0f, 1.0f, 0.0f, 0.0f,
693  0.0f, 0.0f, 1.0f, 0.0f,
694  0.0f, 0.0f, 0.0f, 1.0f);
695  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, NULL, NULL);
696  expect_matrix(&expectedmat, &gotmat, 0);
697 
698  set_matrix(&expectedmat,
699  -0.2148f, 1.3116f, 0.4752f, 0.0f,
700  0.9504f, -0.8836f, 0.9244f, 0.0f,
701  1.0212f, 0.1936f, -1.3588f, 0.0f,
702  9.7f, -8.6f, 1.3f, 1.0f);
703  D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, NULL, &r, &last);
704  expect_matrix(&expectedmat, &gotmat, 8);
705 
706  set_matrix(&expectedmat,
707  1.0f, 0.0f, 0.0f, 0.0f,
708  0.0f, 1.0f, 0.0f, 0.0f,
709  0.0f, 0.0f, 1.0f, 0.0f,
710  9.7f, -8.6f, 1.3f, 1.0f);
711  D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, NULL, &last);
712  expect_matrix(&expectedmat, &gotmat, 0);
713 
714  set_matrix(&expectedmat,
715  1.0f, 0.0f, 0.0f, 0.0f,
716  0.0f, -3.0f, 0.0f, 0.0f,
717  0.0f, 0.0f, 7.0f, 0.0f,
718  9.7f, -8.6f, 1.3f, 1.0f);
719  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, NULL, &last);
720  expect_matrix(&expectedmat, &gotmat, 0);
721 
722  set_matrix(&expectedmat,
723  1.0f, 0.0f, 0.0f, 0.0f,
724  0.0f, 1.0f, 0.0f, 0.0f,
725  0.0f, 0.0f, 1.0f, 0.0f,
726  9.7f, -8.6f, 1.3f, 1.0f);
727  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, NULL, &last);
728  expect_matrix(&expectedmat, &gotmat, 0);
729 
730  set_matrix(&expectedmat,
731  1.0f, 0.0f, 0.0f, 0.0f,
732  0.0f, 1.0f, 0.0f, 0.0f,
733  0.0f, 0.0f, 1.0f, 0.0f,
734  9.7f, -8.6f, 1.3f, 1.0f);
735  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, NULL, &last);
736  expect_matrix(&expectedmat, &gotmat, 0);
737 
738  set_matrix(&expectedmat,
739  -0.2148f, 1.3116f, 0.4752f, 0.0f,
740  0.9504f, -0.8836f, 0.9244f, 0.0f,
741  1.0212f, 0.1936f, -1.3588f, 0.0f,
742  8.5985f, -21.024f, 14.383499, 1.0f);
743  D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, &r, NULL);
744  expect_matrix(&expectedmat, &gotmat, 8);
745 
746  set_matrix(&expectedmat,
747  -0.2148f, 1.3116f, 0.4752f, 0.0f,
748  -2.8512f, 2.6508f, -2.7732f, 0.0f,
749  7.148399f, 1.3552f, -9.5116f, 0.0f,
750  0.0f, 0.0f, 0.0f, 1.0f);
751  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, &r, NULL);
752  expect_matrix(&expectedmat, &gotmat, 8);
753 
754  set_matrix(&expectedmat,
755  -0.2148f, 1.3116f, 0.4752f, 0.0f,
756  0.9504f, -0.8836f, 0.9244f, 0.0f,
757  1.0212f, 0.1936f, -1.3588f, 0.0f,
758  0.0f, 0.0f, 0.0f, 1.0f);
759  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, &r, NULL);
760  expect_matrix(&expectedmat, &gotmat, 8);
761 
762  set_matrix(&expectedmat,
763  -0.2148f, 1.3116f, 0.4752f, 0.0f,
764  0.9504f, -0.8836f, 0.9244f, 0.0f,
765  1.0212f, 0.1936f, -1.3588f, 0.0f,
766  0.0f, 0.0f, 0.0f, 1.0f);
767  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, &r, NULL);
768  expect_matrix(&expectedmat, &gotmat, 8);
769 
770  set_matrix(&expectedmat,
771  1.0f, 0.0f, 0.0f, 0.0f,
772  0.0f, -3.0f, 0.0f, 0.0f,
773  0.0f, 0.0f, 7.0f, 0.0f,
774  0.0f, 0.0f, 0.0f, 1.0f);
775  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, NULL, NULL);
776  expect_matrix(&expectedmat, &gotmat, 0);
777 
778  set_matrix(&expectedmat,
779  1.0f, 0.0f, 0.0f, 0.0f,
780  0.0f, 1.0f, 0.0f, 0.0f,
781  0.0f, 0.0f, 1.0f, 0.0f,
782  0.0f, 0.0f, 0.0f, 1.0f);
783  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, NULL, NULL);
784  expect_matrix(&expectedmat, &gotmat, 0);
785 
786  set_matrix(&expectedmat,
787  1.0f, 0.0f, 0.0f, 0.0f,
788  0.0f, 1.0f, 0.0f, 0.0f,
789  0.0f, 0.0f, 1.0f, 0.0f,
790  0.0f, 0.0f, 0.0f, 1.0f);
791  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, NULL, NULL);
792  expect_matrix(&expectedmat, &gotmat, 0);
793 
794  set_matrix(&expectedmat,
795  25521.0f, 39984.0f, 20148.0f, 0.0f,
796  39984.0f, 4933.0f, -3324.0f, 0.0f,
797  20148.0f, -3324.0f, -5153.0f, 0.0f,
798  0.0f, 0.0f, 0.0f, 1.0f);
799  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
800  expect_matrix(&expectedmat, &gotmat, 0);
801 
802  set_matrix(&expectedmat,
803  1.0f, 0.0f, 0.0f, 0.0f,
804  0.0f, -3.0f, 0.0f, 0.0f,
805  0.0f, 0.0f, 7.0f, 0.0f,
806  0.0f, 52.0f, 54.0f, 1.0f);
807  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, NULL, NULL);
808  expect_matrix(&expectedmat, &gotmat, 0);
809 
810  set_matrix(&expectedmat,
811  1.0f, 0.0f, 0.0f, 0.0f,
812  0.0f, 1.0f, 0.0f, 0.0f,
813  0.0f, 0.0f, 1.0f, 0.0f,
814  0.0f, 0.0f, 0.0f, 1.0f);
815  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, NULL, NULL);
816  expect_matrix(&expectedmat, &gotmat, 0);
817 
818  set_matrix(&expectedmat,
819  -0.2148f, 1.3116f, 0.4752f, 0.0f,
820  0.9504f, -0.8836f, 0.9244f, 0.0f,
821  1.0212f, 0.1936f, -1.3588f, 0.0f,
822  18.2985f, -29.624001f, 15.683499f, 1.0f);
823  D3DXMatrixTransformation(&gotmat, NULL, NULL, NULL, &eye, &r, &last);
824  expect_matrix(&expectedmat, &gotmat, 8);
825 
826  set_matrix(&expectedmat,
827  -0.2148f, 1.3116f, 0.4752f, 0.0f,
828  -2.8512f, 2.6508f, -2.7732f, 0.0f,
829  7.148399f, 1.3552f, -9.5116f, 0.0f,
830  9.7f, -8.6f, 1.3f, 1.0f);
831  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, NULL, &r, &last);
832  expect_matrix(&expectedmat, &gotmat, 8);
833 
834  set_matrix(&expectedmat,
835  -0.2148f, 1.3116f, 0.4752f, 0.0f,
836  0.9504f, -0.8836f, 0.9244f, 0.0f,
837  1.0212f, 0.1936f, -1.3588f, 0.0f,
838  9.7f, -8.6f, 1.3f, 1.0f);
839  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, NULL, &r, &last);
840  expect_matrix(&expectedmat, &gotmat, 8);
841 
842  set_matrix(&expectedmat,
843  -0.2148f, 1.3116f, 0.4752f, 0.0f,
844  0.9504f, -0.8836f, 0.9244f, 0.0f,
845  1.0212f, 0.1936f, -1.3588f, 0.0f,
846  9.7f, -8.6f, 1.3f, 1.0f);
847  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, NULL, &r, &last);
848  expect_matrix(&expectedmat, &gotmat, 8);
849 
850  set_matrix(&expectedmat,
851  1.0f, 0.0f, 0.0f, 0.0f,
852  0.0f, -3.0f, 0.0f, 0.0f,
853  0.0f, 0.0f, 7.0f, 0.0f,
854  9.7f, -8.6f, 1.3f, 1.0f);
855  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, NULL, &last);
856  expect_matrix(&expectedmat, &gotmat, 0);
857 
858  set_matrix(&expectedmat,
859  1.0f, 0.0f, 0.0f, 0.0f,
860  0.0f, 1.0f, 0.0f, 0.0f,
861  0.0f, 0.0f, 1.0f, 0.0f,
862  9.7f, -8.6f, 1.3f, 1.0f);
863  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, NULL, &last);
864  expect_matrix(&expectedmat, &gotmat, 0);
865 
866  set_matrix(&expectedmat,
867  1.0f, 0.0f, 0.0f, 0.0f,
868  0.0f, 1.0f, 0.0f, 0.0f,
869  0.0f, 0.0f, 1.0f, 0.0f,
870  9.7f, -8.6f, 1.3f, 1.0f);
871  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, NULL, &last);
872  expect_matrix(&expectedmat, &gotmat, 0);
873 
874  set_matrix(&expectedmat,
875  25521.0f, 39984.0f, 20148.0f, 0.0f,
876  39984.0f, 4933.0f, -3324.0f, 0.0f,
877  20148.0f, -3324.0f, -5153.0f, 0.0f,
878  9.7f, -8.6f, 1.3f, 1.0f);
879  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, &last);
880  expect_matrix(&expectedmat, &gotmat, 0);
881 
882  set_matrix(&expectedmat,
883  1.0f, 0.0f, 0.0f, 0.0f,
884  0.0f, -3.0f, 0.0f, 0.0f,
885  0.0f, 0.0f, 7.0f, 0.0f,
886  9.7f, 43.400002f, 55.299999f, 1.0f);
887  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, NULL, &last);
888  expect_matrix(&expectedmat, &gotmat, 0);
889 
890  set_matrix(&expectedmat,
891  1.0f, 0.0f, 0.0f, 0.0f,
892  0.0f, 1.0f, 0.0f, 0.0f,
893  0.0f, 0.0f, 1.0f, 0.0f,
894  9.7f, -8.6f, 1.3f, 1.0f);
895  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, NULL, &last);
896  expect_matrix(&expectedmat, &gotmat, 0);
897 
898  set_matrix(&expectedmat,
899  -0.2148f, 1.3116f, 0.4752f, 0.0f,
900  -2.8512f, 2.6508f, -2.7732f, 0.0f,
901  7.148399f, 1.3552f, -9.5116f, 0.0f,
902  8.5985f, -21.024f, 14.383499, 1.0f);
903  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, &r, NULL);
904  expect_matrix(&expectedmat, &gotmat, 8);
905 
906  set_matrix(&expectedmat,
907  -0.2148f, 1.3116f, 0.4752f, 0.0f,
908  0.9504f, -0.8836f, 0.9244f, 0.0f,
909  1.0212f, 0.1936f, -1.3588f, 0.0f,
910  8.5985f, -21.024f, 14.383499, 1.0f);
911  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, &r, NULL);
912  expect_matrix(&expectedmat, &gotmat, 8);
913 
914  set_matrix(&expectedmat,
915  -0.2148f, 1.3116f, 0.4752f, 0.0f,
916  0.9504f, -0.8836f, 0.9244f, 0.0f,
917  1.0212f, 0.1936f, -1.3588f, 0.0f,
918  8.5985f, -21.024f, 14.383499, 1.0f);
919  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, &r, NULL);
920  expect_matrix(&expectedmat, &gotmat, 8);
921 
922  set_matrix(&expectedmat,
923  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
924  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
925  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
926  0.0f, 0.0f, 0.0f, 1.0f);
927  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, &r, NULL);
928  expect_matrix(&expectedmat, &gotmat, 32);
929 
930  set_matrix(&expectedmat,
931  -0.2148f, 1.3116f, 0.4752f, 0.0f,
932  -2.8512f, 2.6508f, -2.7732f, 0.0f,
933  7.148399f, 1.3552f, -9.5116f, 0.0f,
934  104.565598f, -35.492798f, -25.306400f, 1.0f);
935  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, &r, NULL);
936  expect_matrix(&expectedmat, &gotmat, 8);
937 
938  set_matrix(&expectedmat,
939  -0.2148f, 1.3116f, 0.4752f, 0.0f,
940  0.9504f, -0.8836f, 0.9244f, 0.0f,
941  1.0212f, 0.1936f, -1.3588f, 0.0f,
942  0.0f, 0.0f, 0.0f, 1.0f);
943  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, &r, NULL);
944  expect_matrix(&expectedmat, &gotmat, 8);
945 
946  set_matrix(&expectedmat,
947  25521.0f, 39984.0f, 20148.0f, 0.0f,
948  39984.0f, 4933.0f, -3324.0f, 0.0f,
949  20148.0f, -3324.0f, -5153.0f, 0.0f,
950  0.0f, 0.0f, 0.0f, 1.0f);
951  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, NULL, NULL);
952  expect_matrix(&expectedmat, &gotmat, 0);
953 
954  set_matrix(&expectedmat,
955  1.0f, 0.0f, 0.0f, 0.0f,
956  0.0f, -3.0f, 0.0f, 0.0f,
957  0.0f, 0.0f, 7.0f, 0.0f,
958  0.0f, 52.0f, 54.0f, 1.0f);
959  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, NULL, NULL);
960  expect_matrix(&expectedmat, &gotmat, 0);
961 
962  set_matrix(&expectedmat,
963  1.0f, 0.0f, 0.0f, 0.0f,
964  0.0f, 1.0f, 0.0f, 0.0f,
965  0.0f, 0.0f, 1.0f, 0.0f,
966  0.0f, 0.0f, 0.0f, 1.0f);
967  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, NULL, NULL);
968  expect_matrix(&expectedmat, &gotmat, 0);
969 
970  set_matrix(&expectedmat,
971  25521.0f, 39984.0f, 20148.0f, 0.0f,
972  39984.0f, 4933.0f, -3324.0f, 0.0f,
973  20148.0f, -3324.0f, -5153.0f, 0.0f,
974  -287420.0f, -14064.0f, 37122.0f, 1.0f);
975  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, NULL, NULL);
976  expect_matrix(&expectedmat, &gotmat, 0);
977 
978  set_matrix(&expectedmat,
979  -0.2148f, 1.3116f, 0.4752f, 0.0f,
980  -2.8512f, 2.6508f, -2.7732f, 0.0f,
981  7.148399f, 1.3552f, -9.5116f, 0.0f,
982  18.2985f, -29.624001f, 15.683499f, 1.0f);
983  D3DXMatrixTransformation(&gotmat, NULL, NULL, &axis, &eye, &r, &last);
984  expect_matrix(&expectedmat, &gotmat, 8);
985 
986  set_matrix(&expectedmat,
987  -0.2148f, 1.3116f, 0.4752f, 0.0f,
988  0.9504f, -0.8836f, 0.9244f, 0.0f,
989  1.0212f, 0.1936f, -1.3588f, 0.0f,
990  18.2985f, -29.624001f, 15.683499f, 1.0f);
991  D3DXMatrixTransformation(&gotmat, NULL, &q, NULL, &eye, &r, &last);
992  expect_matrix(&expectedmat, &gotmat, 8);
993 
994  set_matrix(&expectedmat,
995  -0.2148f, 1.3116f, 0.4752f, 0.0f,
996  0.9504f, -0.8836f, 0.9244f, 0.0f,
997  1.0212f, 0.1936f, -1.3588f, 0.0f,
998  18.2985f, -29.624001f, 15.683499f, 1.0f);
999  D3DXMatrixTransformation(&gotmat, &at, NULL, NULL, &eye, &r, &last);
1000  expect_matrix(&expectedmat, &gotmat, 8);
1001 
1002  set_matrix(&expectedmat,
1003  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
1004  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
1005  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
1006  9.7f, -8.6f, 1.3f, 1.0f);
1007  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, &r, &last);
1008  expect_matrix(&expectedmat, &gotmat, 32);
1009 
1010  set_matrix(&expectedmat,
1011  -0.2148f, 1.3116f, 0.4752f, 0.0f,
1012  -2.8512f, 2.6508f, -2.7732f, 0.0f,
1013  7.148399f, 1.3552f, -9.5116f, 0.0f,
1014  114.265594f, -44.092796f, -24.006401f, 1.0f);
1015  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, NULL, &r, &last);
1016  expect_matrix(&expectedmat, &gotmat, 8);
1017 
1018  set_matrix(&expectedmat,
1019  -0.2148f, 1.3116f, 0.4752f, 0.0f,
1020  0.9504f, -0.8836f, 0.9244f, 0.0f,
1021  1.0212f, 0.1936f, -1.3588f, 0.0f,
1022  9.7f, -8.6f, 1.3f, 1.0f);
1023  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, NULL, &r, &last);
1024  expect_matrix(&expectedmat, &gotmat, 8);
1025 
1026  set_matrix(&expectedmat,
1027  25521.0f, 39984.0f, 20148.0f, 0.0f,
1028  39984.0f, 4933.0f, -3324.0f, 0.0f,
1029  20148.0f, -3324.0f, -5153.0f, 0.0f,
1030  9.7f, -8.6f, 1.3f, 1.0f);
1031  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, NULL, &last);
1032  expect_matrix(&expectedmat, &gotmat, 0);
1033 
1034  set_matrix(&expectedmat,
1035  1.0f, 0.0f, 0.0f, 0.0f,
1036  0.0f, -3.0f, 0.0f, 0.0f,
1037  0.0f, 0.0f, 7.0f, 0.0f,
1038  9.7f, 43.400002f, 55.299999f, 1.0f);
1039  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, NULL, &last);
1040  expect_matrix(&expectedmat, &gotmat, 0);
1041 
1042  set_matrix(&expectedmat,
1043  1.0f, 0.0f, 0.0f, 0.0f,
1044  0.0f, 1.0f, 0.0f, 0.0f,
1045  0.0f, 0.0f, 1.0f, 0.0f,
1046  9.7f, -8.6f, 1.3f, 1.0f);
1047  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, NULL, &last);
1048  expect_matrix(&expectedmat, &gotmat, 0);
1049 
1050  set_matrix(&expectedmat,
1051  25521.0f, 39984.0f, 20148.0f, 0.0f,
1052  39984.0f, 4933.0f, -3324.0f, 0.0f,
1053  20148.0f, -3324.0f, -5153.0f, 0.0f,
1054  -287410.3125f, -14072.599609f, 37123.300781f, 1.0f);
1055  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, NULL, &last);
1056  expect_matrix(&expectedmat, &gotmat, 0);
1057 
1058  set_matrix(&expectedmat,
1059  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
1060  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
1061  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
1062  8.598499f, -21.024f, 14.383499f, 1.0f);
1063  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, &r, NULL);
1064  expect_matrix(&expectedmat, &gotmat, 32);
1065 
1066  set_matrix(&expectedmat,
1067  -0.2148f, 1.3116f, 0.4752f, 0.0f,
1068  -2.8512f, 2.6508f, -2.7732f, 0.0f,
1069  7.148399f, 1.3552f, -9.5116f, 0.0f,
1070  113.164093f, -56.5168f, -10.922897f, 1.0f);
1071  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, &r, NULL);
1072  expect_matrix(&expectedmat, &gotmat, 8);
1073 
1074  set_matrix(&expectedmat,
1075  -0.2148f, 1.3116f, 0.4752f, 0.0f,
1076  0.9504f, -0.8836f, 0.9244f, 0.0f,
1077  1.0212f, 0.1936f, -1.3588f, 0.0f,
1078  8.5985f, -21.024f, 14.383499, 1.0f);
1079  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, &r, NULL);
1080  expect_matrix(&expectedmat, &gotmat, 8);
1081 
1082  set_matrix(&expectedmat,
1083  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
1084  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
1085  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
1086  86280.34375f, -357366.3125f, -200024.125f, 1.0f);
1087  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, &r, NULL);
1088  expect_matrix(&expectedmat, &gotmat, 32);
1089 
1090  set_matrix(&expectedmat,
1091  25521.0f, 39984.0f, 20148.0f, 0.0f,
1092  39984.0f, 4933.0f, -3324.0f, 0.0f,
1093  20148.0f, -3324.0f, -5153.0f, 0.0f,
1094  -287410.3125f, -14064.0f, 37122.0f, 1.0f);
1095  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, &eye, NULL, NULL);
1096  expect_matrix(&expectedmat, &gotmat, 512);
1097 
1098  set_matrix(&expectedmat,
1099  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
1100  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
1101  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
1102  86280.34375f, -357366.3125f, -200009.75f, 1.0f);
1103  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, &eye, &r, NULL);
1104  expect_matrix(&expectedmat, &gotmat, 2048);
1105 
1106  set_matrix(&expectedmat,
1107  25521.0f, 39984.0f, 20148.0f, 0.0f,
1108  39984.0f, 4933.0f, -3324.0f, 0.0f,
1109  20148.0f, -3324.0f, -5153.0f, 0.0f,
1110  -287410.3125f, -14072.599609f, 37123.300781f, 1.0f);
1111  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, &eye, NULL, &last);
1112  expect_matrix(&expectedmat, &gotmat, 0);
1113 
1114  set_matrix(&expectedmat,
1115  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
1116  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
1117  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
1118  86290.046875f, -357374.90625f, -200022.828125f, 1.0f);
1119  D3DXMatrixTransformation(&gotmat, &at, &q, &axis, NULL, &r, &last);
1120  expect_matrix(&expectedmat, &gotmat, 32);
1121 
1122  set_matrix(&expectedmat,
1123  -0.21480007f, 1.3116000f, 0.47520003f, 0.0f,
1124  0.95040143f, -0.88360137f, 0.92439979f, 0.0f,
1125  1.0212044f, 0.19359307f, -1.3588026f, 0.0f,
1126  18.298532f, -29.624001f, 15.683499f, 1.0f);
1127  D3DXMatrixTransformation(&gotmat, &at, &q, NULL, &eye, &r, &last);
1128  expect_matrix(&expectedmat, &gotmat, 512);
1129 
1130  set_matrix(&expectedmat,
1131  -0.2148f, 1.3116f, 0.4752f, 0.0f,
1132  -2.8512f, 2.6508f, -2.7732f, 0.0f,
1133  7.148399f, 1.3552f, -9.5116f, 0.0f,
1134  122.86409f, -65.116798f, -9.622897f, 1.0f);
1135  D3DXMatrixTransformation(&gotmat, &at, NULL, &axis, &eye, &r, &last);
1136  expect_matrix(&expectedmat, &gotmat, 8);
1137 
1138  set_matrix(&expectedmat,
1139  53094.015625f, 2044.133789f, 21711.687500f, 0.0f,
1140  -7294.705078f, 47440.683594f, 28077.113281, 0.0f,
1141  -12749.161133f, 28365.580078f, 13503.520508f, 0.0f,
1142  18.2985f, -29.624001f, 15.683499f, 1.0f);
1143  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, &eye, &r, &last);
1144  expect_matrix(&expectedmat, &gotmat, 32);
1145 
1146  q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 1.0f,
1147  axis.x = 1.0f, axis.y = 1.0f, axis.z = 2.0f,
1148 
1149  set_matrix(&expectedmat,
1150  41.0f, -12.0f, -24.0f, 0.0f,
1151  -12.0f, 25.0f, -12.0f, 0.0f,
1152  -24.0f, -12.0f, 34.0f, 0.0f,
1153  0.0f, 0.0f, 0.0f, 1.0f);
1154  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1155  expect_matrix(&expectedmat, &gotmat, 0);
1156 
1157  q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 1.0f,
1158  axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
1159 
1160  set_matrix(&expectedmat,
1161  57.0f, -12.0f, -36.0f, 0.0f,
1162  -12.0f, 25.0f, -12.0f, 0.0f,
1163  -36.0f, -12.0f, 43.0f, 0.0f,
1164  0.0f, 0.0f, 0.0f, 1.0f);
1165  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1166  expect_matrix(&expectedmat, &gotmat, 0);
1167 
1168  q.x = 1.0f, q.y = 1.0f, q.z = 1.0f, q.w = 0.0f,
1169  axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
1170 
1171  set_matrix(&expectedmat,
1172  25.0f, 0.0f, -20.0f, 0.0f,
1173  0.0f, 25.0f, -20.0f, 0.0f,
1174  -20.0f, -20.0f, 35.0f, 0.0f,
1175  0.0f, 0.0f, 0.0f, 1.0f);
1176  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1177  expect_matrix(&expectedmat, &gotmat, 0);
1178 
1179  q.x = 1.0f, q.y = 1.0f, q.z = 0.0f, q.w = 0.0f,
1180  axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
1181 
1182  set_matrix(&expectedmat,
1183  5.0f, -4.0f, 0.0f, 0.0f,
1184  -4.0f, 5.0f, 0.0f, 0.0f,
1185  0.0f, 0.0f, 27.0f, 0.0f,
1186  0.0f, 0.0f, 0.0f, 1.0f);
1187  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1188  expect_matrix(&expectedmat, &gotmat, 0);
1189 
1190  q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f,
1191  axis.x = 5.0f, axis.y = 2.0f, axis.z = 1.0f,
1192 
1193  set_matrix(&expectedmat,
1194  5.0f, 0.0f, 0.0f, 0.0f,
1195  0.0f, 2.0f, 0.0f, 0.0f,
1196  0.0f, 0.0f, 1.0f, 0.0f,
1197  0.0f, 0.0f, 0.0f, 1.0f);
1198  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1199  expect_matrix(&expectedmat, &gotmat, 0);
1200 
1201  q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f,
1202  axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
1203 
1204  set_matrix(&expectedmat,
1205  1.0f, 0.0f, 0.0f, 0.0f,
1206  0.0f, 4.0f, 0.0f, 0.0f,
1207  0.0f, 0.0f, 1.0f, 0.0f,
1208  0.0f, 0.0f, 0.0f, 1.0f);
1209  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1210  expect_matrix(&expectedmat, &gotmat, 0);
1211 
1212  q.x = 0.0f, q.y = 1.0f, q.z = 0.0f, q.w = 0.0f,
1213  axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
1214 
1215  set_matrix(&expectedmat,
1216  1.0f, 0.0f, 0.0f, 0.0f,
1217  0.0f, 4.0f, 0.0f, 0.0f,
1218  0.0f, 0.0f, 1.0f, 0.0f,
1219  0.0f, 0.0f, 0.0f, 1.0f);
1220  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1221  expect_matrix(&expectedmat, &gotmat, 0);
1222 
1223  q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 1.0f,
1224  axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
1225 
1226  set_matrix(&expectedmat,
1227  1.0f, 0.0f, 0.0f, 0.0f,
1228  0.0f, 8.0f, -6.0f, 0.0f,
1229  0.0f, -6.0f, 17.0f, 0.0f,
1230  0.0f, 0.0f, 0.0f, 1.0f);
1231  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1232  expect_matrix(&expectedmat, &gotmat, 0);
1233 
1234  q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 1.0f,
1235  axis.x = 0.0f, axis.y = 4.0f, axis.z = 0.0f,
1236 
1237  set_matrix(&expectedmat,
1238  0.0f, 0.0f, 0.0f, 0.0f,
1239  0.0f, 4.0f, -8.0f, 0.0f,
1240  0.0f, -8.0f, 16.0f, 0.0f,
1241  0.0f, 0.0f, 0.0f, 1.0f);
1242  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1243  expect_matrix(&expectedmat, &gotmat, 0);
1244 
1245  q.x = 0.0f, q.y = 1.0f, q.z = 0.0f, q.w = 1.0f,
1246  axis.x = 1.0f, axis.y = 4.0f, axis.z = 1.0f,
1247 
1248  set_matrix(&expectedmat,
1249  5.0f, 0.0f, 0.0f, 0.0f,
1250  0.0f, 4.0f, 0.0f, 0.0f,
1251  0.0f, 0.0f, 5.0f, 0.0f,
1252  0.0f, 0.0f, 0.0f, 1.0f);
1253  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1254  expect_matrix(&expectedmat, &gotmat, 0);
1255 
1256  q.x = 1.0f, q.y = 0.0f, q.z = 0.0f, q.w = 0.0f,
1257  axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
1258 
1259  set_matrix(&expectedmat,
1260  1.0f, 0.0f, 0.0f, 0.0f,
1261  0.0f, 1.0f, 0.0f, 0.0f,
1262  0.0f, 0.0f, 3.0f, 0.0f,
1263  0.0f, 0.0f, 0.0f, 1.0f);
1264  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1265  expect_matrix(&expectedmat, &gotmat, 0);
1266 
1267  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1268  axis.x = 3.0f, axis.y = 3.0f, axis.z = 3.0f,
1269 
1270  set_matrix(&expectedmat,
1271  3796587.0f, -1377948.0f, -1589940.0f, 0.0f,
1272  -1377948.0f, 3334059.0f, -1879020.0f, 0.0f,
1273  -1589940.0f, -1879020.0f, 2794443.0f, 0.0f,
1274  0.0f, 0.0f, 0.0f, 1.0f);
1275  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1276  expect_matrix(&expectedmat, &gotmat, 0);
1277 
1278  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1279  axis.x = 1.0f, axis.y = 1.0f, axis.z = 1.0f,
1280 
1281  set_matrix(&expectedmat,
1282  1265529.0f, -459316.0f, -529980.0f, 0.0f,
1283  -459316.0f, 1111353.0f, -626340.0f, 0.0f,
1284  -529980.0f, -626340.0f, 931481.0f, 0.0f,
1285  0.0f, 0.0f, 0.0f, 1.0f);
1286  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1287  expect_matrix(&expectedmat, &gotmat, 0);
1288 
1289  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1290  axis.x = 1.0f, axis.y = 1.0f, axis.z = 3.0f,
1291 
1292  set_matrix(&expectedmat,
1293  2457497.0f, -434612.0f, -1423956.0f, 0.0f,
1294  -434612.0f, 1111865.0f, -644868.0f, 0.0f,
1295  -1423956.0f, -644868.0f, 1601963.0f, 0.0f,
1296  0.0f, 0.0f, 0.0f, 1.0f);
1297  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1298  expect_matrix(&expectedmat, &gotmat, 0);
1299 
1300  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1301  axis.x = 0.0f, axis.y = 0.0f, axis.z = 3.0f,
1302 
1303  set_matrix(&expectedmat,
1304  1787952.0f, 37056.0f, -1340964.0f, 0.0f,
1305  37056.0f, 768.0f, -27792.0f, 0.0f,
1306  -1340964.0f, -27792.0f, 1005723.0f, 0.0f,
1307  0.0f, 0.0f, 0.0f, 1.0f);
1308  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1309  expect_matrix(&expectedmat, &gotmat, 0);
1310 
1311  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1312  axis.x = 0.0f, axis.y = 0.0f, axis.z = 1.0f,
1313 
1314  set_matrix(&expectedmat,
1315  595984.0f, 12352.0f, -446988.0f, 0.0f,
1316  12352.0f, 256.0f, -9264.0f, 0.0f,
1317  -446988.0f, -9264.0f, 335241.0f, 0.0f,
1318  0.0f, 0.0f, 0.0f, 1.0f);
1319  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1320  expect_matrix(&expectedmat, &gotmat, 0);
1321 
1322  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1323  axis.x = 0.0f, axis.y = 3.0f, axis.z = 0.0f,
1324 
1325  set_matrix(&expectedmat,
1326  150528.0f, 464352.0f, -513408.0f, 0.0f,
1327  464352.0f, 1432443.0f, -1583772.0f, 0.0f,
1328  -513408.0f, -1583772.0f, 1751088.0f, 0.0f,
1329  0.0f, 0.0f, 0.0f, 1.0f);
1330  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1331  expect_matrix(&expectedmat, &gotmat, 0);
1332 
1333  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1334  axis.x = 0.0f, axis.y = 1.0f, axis.z = 0.0f,
1335 
1336  set_matrix(&expectedmat,
1337  50176.0f, 154784.0f, -171136.0f, 0.0f,
1338  154784.0f, 477481.0f, -527924.0f, 0.0f,
1339  -171136.0f, -527924.0f, 583696.0f, 0.0f,
1340  0.0f, 0.0f, 0.0f, 1.0f);
1341  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1342  expect_matrix(&expectedmat, &gotmat, 0);
1343 
1344  q.x = 11.0f, q.y = 13.0f, q.z = 15.0f, q.w = 17.0f,
1345  axis.x = 1.0f, axis.y = 0.0f, axis.z = 0.0f,
1346 
1347  set_matrix(&expectedmat,
1348  619369.0f, -626452.0f, 88144.0f, 0.0f,
1349  -626452.0f, 633616.0f, -89152.0f, 0.0f,
1350  88144.0f, -89152, 12544.0f, 0.0f,
1351  0.0f, 0.0f, 0.0f, 1.0f);
1352  D3DXMatrixTransformation(&gotmat, NULL, &q, &axis, NULL, NULL, NULL);
1353  expect_matrix(&expectedmat, &gotmat, 0);
1354 
1355 /*____________D3DXMatrixTranslation______________*/
1356  set_matrix(&expectedmat,
1357  1.0f, 0.0f, 0.0f, 0.0f,
1358  0.0f, 1.0f, 0.0f, 0.0f,
1359  0.0f, 0.0f, 1.0f, 0.0f,
1360  0.69f, 0.53f, 4.11f, 1.0f);
1361  D3DXMatrixTranslation(&gotmat, 0.69f, 0.53f, 4.11f);
1362  expect_matrix(&expectedmat, &gotmat, 0);
1363 
1364 /*____________D3DXMatrixTranspose______________*/
1365  set_matrix(&expectedmat,
1366  10.0f, 11.0f, 19.0f, 2.0f,
1367  5.0f, 20.0f, -21.0f, 3.0f,
1368  7.0f, 16.0f, 30.f, -4.0f,
1369  8.0f, 33.0f, 43.0f, -40.0f);
1370  D3DXMatrixTranspose(&gotmat, &mat);
1371  expect_matrix(&expectedmat, &gotmat, 0);
1372 }
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
D3DXMATRIX *WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
Definition: math.c:412
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
D3DXMATRIX *WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z)
Definition: math.c:862
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
static void set_matrix(D3DXMATRIX *mat, float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
Definition: math.c:196
POINT last
Definition: font.c:46
#define TRUE
Definition: types.h:120
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
Definition: math.c:393
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define U(x)
Definition: wordpad.c:45
#define equal(x, y)
Definition: reader.cc:56
D3DXMATRIX *WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
Definition: math.c:427
static const MAT2 mat
Definition: font.c:66
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
GLfloat angle
Definition: glext.h:10853
D3DXMATRIX *WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
Definition: math.c:467
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
D3DXMATRIX *WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle)
Definition: math.c:639
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
D3DXMATRIX *WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, const D3DXVECTOR4 *plight, const D3DXPLANE *pplane)
Definition: math.c:719
D3DXMATRIX *WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *out, const D3DXVECTOR3 *eye, const D3DXVECTOR3 *at, const D3DXVECTOR3 *up)
Definition: math.c:327
smooth NULL
Definition: ftsmooth.c:416
D3DXMATRIX *WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, const D3DXMATRIX *pm)
Definition: math.c:254
D3DXMATRIX *WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, const D3DXMATRIX *pm)
Definition: math.c:873
D3DXMATRIX *WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *out, FLOAT scaling, const D3DXVECTOR3 *rotationcenter, const D3DXQUATERNION *rotation, const D3DXVECTOR3 *translation)
Definition: math.c:90
GLfloat f
Definition: glext.h:7540
D3DXMATRIX *WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *out, const D3DXVECTOR3 *v, FLOAT angle)
Definition: math.c:590
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
Definition: math.c:453
D3DXMATRIX *WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *out, FLOAT yaw, FLOAT pitch, FLOAT roll)
Definition: math.c:663
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf)
Definition: math.c:493
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
Definition: math.c:439
D3DXMATRIX *WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle)
Definition: math.c:696
D3DXMATRIX *WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *out, const D3DXVECTOR3 *eye, const D3DXVECTOR3 *at, const D3DXVECTOR3 *up)
Definition: math.c:360
D3DXMATRIX *WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle)
Definition: math.c:651
D3DXMATRIX *WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz)
Definition: math.c:708
#define ok(value,...)
Definition: atltest.h:57
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
Definition: math.c:507
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
Definition: math.c:553
D3DXMATRIX *WINAPI D3DXMatrixReflect(D3DXMATRIX *pout, const D3DXPLANE *pplane)
Definition: math.c:567
D3DXMATRIX *WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, const D3DXQUATERNION *pq)
Definition: math.c:622
D3DXMATRIX *WINAPI D3DXMatrixTransformation(D3DXMATRIX *out, const D3DXVECTOR3 *scaling_center, const D3DXQUATERNION *scaling_rotation, const D3DXVECTOR3 *scaling, const D3DXVECTOR3 *rotation_center, const D3DXQUATERNION *rotation, const D3DXVECTOR3 *translation)
Definition: math.c:747
#define expect_matrix(expected, matrix, ulps)
Definition: math.c:158
#define D3DX_PI
Definition: d3dx9math.h:27
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
Definition: math.c:521
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
Definition: math.c:537
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf)
Definition: math.c:479
FLOAT WINAPI D3DXMatrixDeterminant(const D3DXMATRIX *pm)
Definition: math.c:232
#define memset(x, y, z)
Definition: compat.h:39
BOOL expected
Definition: store.c:2063

Referenced by START_TEST().

◆ D3DXPlaneTest()

static void D3DXPlaneTest ( void  )
static

Definition at line 1374 of file math.c.

1375 {
1376  D3DXMATRIX mat;
1377  D3DXPLANE expectedplane, gotplane, nulplane, plane;
1378  D3DXVECTOR3 expectedvec, gotvec, vec1, vec2, vec3;
1379  LPD3DXVECTOR3 funcpointer;
1380  D3DXVECTOR4 vec;
1381  FLOAT expected, got;
1382 
1383  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1384  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1385  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1386  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1387  U(mat).m[0][0] = 10.0f; U(mat).m[1][1] = 20.0f; U(mat).m[2][2] = 30.0f;
1388  U(mat).m[3][3] = -40.0f;
1389 
1390  plane.a = -3.0f; plane.b = -1.0f; plane.c = 4.0f; plane.d = 7.0f;
1391 
1392  vec.x = 2.0f; vec.y = 5.0f; vec.z = -6.0f; vec.w = 11.0f;
1393 
1394 /*_______________D3DXPlaneDot________________*/
1395  expected = 42.0f;
1396  got = D3DXPlaneDot(&plane,&vec),
1397  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1398  expected = 0.0f;
1399  got = D3DXPlaneDot(NULL,&vec),
1400  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1401  expected = 0.0f;
1402  got = D3DXPlaneDot(NULL,NULL),
1403  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1404 
1405 /*_______________D3DXPlaneDotCoord________________*/
1406  expected = -28.0f;
1407  got = D3DXPlaneDotCoord(&plane,&vec),
1408  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1409  expected = 0.0f;
1410  got = D3DXPlaneDotCoord(NULL,&vec),
1411  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1412  expected = 0.0f;
1413  got = D3DXPlaneDotCoord(NULL,NULL),
1414  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1415 
1416 /*_______________D3DXPlaneDotNormal______________*/
1417  expected = -35.0f;
1418  got = D3DXPlaneDotNormal(&plane,&vec),
1419  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1420  expected = 0.0f;
1421  got = D3DXPlaneDotNormal(NULL,&vec),
1422  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1423  expected = 0.0f;
1424  got = D3DXPlaneDotNormal(NULL,NULL),
1425  ok( expected == got, "Expected : %f, Got : %f\n",expected, got);
1426 
1427 /*_______________D3DXPlaneFromPointNormal_______*/
1428  vec1.x = 11.0f; vec1.y = 13.0f; vec1.z = 15.0f;
1429  vec2.x = 17.0f; vec2.y = 31.0f; vec2.z = 24.0f;
1430  expectedplane.a = 17.0f; expectedplane.b = 31.0f; expectedplane.c = 24.0f; expectedplane.d = -950.0f;
1431  D3DXPlaneFromPointNormal(&gotplane, &vec1, &vec2);
1432  expect_plane(&expectedplane, &gotplane, 0);
1433  gotplane.a = vec2.x; gotplane.b = vec2.y; gotplane.c = vec2.z;
1434  D3DXPlaneFromPointNormal(&gotplane, &vec1, (D3DXVECTOR3 *)&gotplane);
1435  expect_plane(&expectedplane, &gotplane, 0);
1436  gotplane.a = vec1.x; gotplane.b = vec1.y; gotplane.c = vec1.z;
1437  expectedplane.d = -1826.0f;
1438  D3DXPlaneFromPointNormal(&gotplane, (D3DXVECTOR3 *)&gotplane, &vec2);
1439  expect_plane(&expectedplane, &gotplane, 0);
1440 
1441 /*_______________D3DXPlaneFromPoints_______*/
1442  vec1.x = 1.0f; vec1.y = 2.0f; vec1.z = 3.0f;
1443  vec2.x = 1.0f; vec2.y = -6.0f; vec2.z = -5.0f;
1444  vec3.x = 83.0f; vec3.y = 74.0f; vec3.z = 65.0f;
1445  expectedplane.a = 0.085914f; expectedplane.b = -0.704492f; expectedplane.c = 0.704492f; expectedplane.d = -0.790406f;
1446  D3DXPlaneFromPoints(&gotplane,&vec1,&vec2,&vec3);
1447  expect_plane(&expectedplane, &gotplane, 64);
1448 
1449 /*_______________D3DXPlaneIntersectLine___________*/
1450  vec1.x = 9.0f; vec1.y = 6.0f; vec1.z = 3.0f;
1451  vec2.x = 2.0f; vec2.y = 5.0f; vec2.z = 8.0f;
1452  expectedvec.x = 20.0f/3.0f; expectedvec.y = 17.0f/3.0f; expectedvec.z = 14.0f/3.0f;
1453  D3DXPlaneIntersectLine(&gotvec,&plane,&vec1,&vec2);
1454  expect_vec3(&expectedvec, &gotvec, 1);
1455  /* Test a parallel line */
1456  vec1.x = 11.0f; vec1.y = 13.0f; vec1.z = 15.0f;
1457  vec2.x = 17.0f; vec2.y = 31.0f; vec2.z = 24.0f;
1458  expectedvec.x = 20.0f/3.0f; expectedvec.y = 17.0f/3.0f; expectedvec.z = 14.0f/3.0f;
1459  funcpointer = D3DXPlaneIntersectLine(&gotvec,&plane,&vec1,&vec2);
1460  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1461 
1462 /*_______________D3DXPlaneNormalize______________*/
1463  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);
1464  D3DXPlaneNormalize(&gotplane, &plane);
1465  expect_plane(&expectedplane, &gotplane, 2);
1466  nulplane.a = 0.0; nulplane.b = 0.0f, nulplane.c = 0.0f; nulplane.d = 0.0f;
1467  expectedplane.a = 0.0f; expectedplane.b = 0.0f; expectedplane.c = 0.0f; expectedplane.d = 0.0f;
1468  D3DXPlaneNormalize(&gotplane, &nulplane);
1469  expect_plane(&expectedplane, &gotplane, 0);
1470 
1471 /*_______________D3DXPlaneTransform____________*/
1472  expectedplane.a = 49.0f; expectedplane.b = -98.0f; expectedplane.c = 55.0f; expectedplane.d = -165.0f;
1473  D3DXPlaneTransform(&gotplane,&plane,&mat);
1474  expect_plane(&expectedplane, &gotplane, 0);
1475 }
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
FT_Pos y
Definition: ftimage.h:77
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
FT_Pos x
Definition: ftimage.h:76
#define U(x)
Definition: wordpad.c:45
FLOAT d
Definition: d3dx9math.h:221
D3DXVECTOR3 *WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, const D3DXPLANE *pp, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2)
Definition: math.c:1227
static const MAT2 mat
Definition: font.c:66
#define expect_plane(expected, plane, ulps)
Definition: math.c:138
D3DXPLANE *WINAPI D3DXPlaneTransform(D3DXPLANE *pout, const D3DXPLANE *pplane, const D3DXMATRIX *pm)
Definition: math.c:1274
smooth NULL
Definition: ftsmooth.c:416
#define expect_vec3(expected, vector, ulps)
Definition: math.c:111
D3DXPLANE *WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, const D3DXVECTOR3 *pvpoint, const D3DXVECTOR3 *pvnormal)
Definition: math.c:1200
GLfloat f
Definition: glext.h:7540
D3DXPLANE *WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pv3)
Definition: math.c:1211
FT_Vector * vec
Definition: ftbbox.c:448
FLOAT c
Definition: d3dx9math.h:221
FLOAT b
Definition: d3dx9math.h:221
#define ok(value,...)
Definition: atltest.h:57
float FLOAT
Definition: typedefs.h:69
D3DXPLANE *WINAPI D3DXPlaneNormalize(D3DXPLANE *out, const D3DXPLANE *p)
Definition: math.c:1249
FLOAT a
Definition: d3dx9math.h:221
BOOL expected
Definition: store.c:2063

Referenced by START_TEST().

◆ D3DXQuaternionTest()

static void D3DXQuaternionTest ( void  )
static

Definition at line 1477 of file math.c.

1478 {
1479  D3DXMATRIX mat;
1480  D3DXQUATERNION expectedquat, gotquat, Nq, Nq1, nul, smallq, smallr, q, r, s, t, u;
1481  BOOL expectedbool, gotbool, equal;
1482  float angle, got, scale, scale2;
1483  LPD3DXQUATERNION funcpointer;
1484  D3DXVECTOR3 axis, expectedvec;
1485 
1486  nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f; nul.w = 0.0f;
1487  q.x = 1.0f, q.y = 2.0f; q.z = 4.0f; q.w = 10.0f;
1488  r.x = -3.0f; r.y = 4.0f; r.z = -5.0f; r.w = 7.0;
1489  t.x = -1111.0f, t.y = 111.0f; t.z = -11.0f; t.w = 1.0f;
1490  u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f;
1491  smallq.x = 0.1f; smallq.y = 0.2f; smallq.z= 0.3f; smallq.w = 0.4f;
1492  smallr.x = 0.5f; smallr.y = 0.6f; smallr.z= 0.7f; smallr.w = 0.8f;
1493 
1494  scale = 0.3f;
1495  scale2 = 0.78f;
1496 
1497 /*_______________D3DXQuaternionBaryCentric________________________*/
1498  expectedquat.x = -867.444458; expectedquat.y = 87.851111f; expectedquat.z = -9.937778f; expectedquat.w = 3.235555f;
1499  D3DXQuaternionBaryCentric(&gotquat,&q,&r,&t,scale,scale2);
1500  expect_quaternion(&expectedquat, &gotquat, 1);
1501 
1502 /*_______________D3DXQuaternionConjugate________________*/
1503  expectedquat.x = -1.0f; expectedquat.y = -2.0f; expectedquat.z = -4.0f; expectedquat.w = 10.0f;
1504  D3DXQuaternionConjugate(&gotquat,&q);
1505  expect_quaternion(&expectedquat, &gotquat, 0);
1506  /* Test the NULL case */
1507  funcpointer = D3DXQuaternionConjugate(&gotquat,NULL);
1508  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1509  funcpointer = D3DXQuaternionConjugate(NULL,NULL);
1510  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1511 
1512 /*_______________D3DXQuaternionDot______________________*/
1513  got = D3DXQuaternionDot(&q,&r);
1514  equal = compare_float(got, 55.0f, 0);
1515  ok(equal, "Got unexpected dot %.8e.\n", got);
1516  /* Tests the case NULL */
1517  got = D3DXQuaternionDot(NULL,&r);
1518  equal = compare_float(got, 0.0f, 0);
1519  ok(equal, "Got unexpected dot %.8e.\n", got);
1520  got = D3DXQuaternionDot(NULL,NULL);
1521  equal = compare_float(got, 0.0f, 0);
1522  ok(equal, "Got unexpected dot %.8e.\n", got);
1523 
1524 /*_______________D3DXQuaternionExp______________________________*/
1525  expectedquat.x = -0.216382f; expectedquat.y = -0.432764f; expectedquat.z = -0.8655270f; expectedquat.w = -0.129449f;
1526  D3DXQuaternionExp(&gotquat,&q);
1527  expect_quaternion(&expectedquat, &gotquat, 16);
1528  /* Test the null quaternion */
1529  expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 1.0f;
1530  D3DXQuaternionExp(&gotquat,&nul);
1531  expect_quaternion(&expectedquat, &gotquat, 0);
1532  /* Test the case where the norm of the quaternion is <1 */
1533  Nq1.x = 0.2f; Nq1.y = 0.1f; Nq1.z = 0.3; Nq1.w= 0.9f;
1534  expectedquat.x = 0.195366; expectedquat.y = 0.097683f; expectedquat.z = 0.293049f; expectedquat.w = 0.930813f;
1535  D3DXQuaternionExp(&gotquat,&Nq1);
1536  expect_quaternion(&expectedquat, &gotquat, 8);
1537 
1538 /*_______________D3DXQuaternionIdentity________________*/
1539  expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 1.0f;
1540  D3DXQuaternionIdentity(&gotquat);
1541  expect_quaternion(&expectedquat, &gotquat, 0);
1542  /* Test the NULL case */
1543  funcpointer = D3DXQuaternionIdentity(NULL);
1544  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1545 
1546 /*_______________D3DXQuaternionInverse________________________*/
1547  expectedquat.x = -1.0f/121.0f; expectedquat.y = -2.0f/121.0f; expectedquat.z = -4.0f/121.0f; expectedquat.w = 10.0f/121.0f;
1548  D3DXQuaternionInverse(&gotquat,&q);
1549  expect_quaternion(&expectedquat, &gotquat, 0);
1550 
1551  expectedquat.x = 1.0f; expectedquat.y = 2.0f; expectedquat.z = 4.0f; expectedquat.w = 10.0f;
1552  D3DXQuaternionInverse(&gotquat,&gotquat);
1553  expect_quaternion(&expectedquat, &gotquat, 1);
1554 
1555 
1556 /*_______________D3DXQuaternionIsIdentity________________*/
1557  s.x = 0.0f; s.y = 0.0f; s.z = 0.0f; s.w = 1.0f;
1558  expectedbool = TRUE;
1559  gotbool = D3DXQuaternionIsIdentity(&s);
1560  ok( expectedbool == gotbool, "Expected boolean : %d, Got bool : %d\n", expectedbool, gotbool);
1561  s.x = 2.3f; s.y = -4.2f; s.z = 1.2f; s.w=0.2f;
1562  expectedbool = FALSE;
1563  gotbool = D3DXQuaternionIsIdentity(&q);
1564  ok( expectedbool == gotbool, "Expected boolean : %d, Got bool : %d\n", expectedbool, gotbool);
1565  /* Test the NULL case */
1566  gotbool = D3DXQuaternionIsIdentity(NULL);
1567  ok(gotbool == FALSE, "Expected boolean: %d, Got boolean: %d\n", FALSE, gotbool);
1568 
1569 /*_______________D3DXQuaternionLength__________________________*/
1570  got = D3DXQuaternionLength(&q);
1571  equal = compare_float(got, 11.0f, 0);
1572  ok(equal, "Got unexpected length %.8e.\n", got);
1573  /* Tests the case NULL. */
1574  got = D3DXQuaternionLength(NULL);
1575  equal = compare_float(got, 0.0f, 0);
1576  ok(equal, "Got unexpected length %.8e.\n", got);
1577 
1578 /*_______________D3DXQuaternionLengthSq________________________*/
1579  got = D3DXQuaternionLengthSq(&q);
1580  equal = compare_float(got, 121.0f, 0);
1581  ok(equal, "Got unexpected length %.8e.\n", got);
1582  /* Tests the case NULL */
1583  got = D3DXQuaternionLengthSq(NULL);
1584  equal = compare_float(got, 0.0f, 0);
1585  ok(equal, "Got unexpected length %.8e.\n", got);
1586 
1587 /*_______________D3DXQuaternionLn______________________________*/
1588  expectedquat.x = 1.0f; expectedquat.y = 2.0f; expectedquat.z = 4.0f; expectedquat.w = 0.0f;
1589  D3DXQuaternionLn(&gotquat,&q);
1590  expect_quaternion(&expectedquat, &gotquat, 0);
1591  expectedquat.x = -3.0f; expectedquat.y = 4.0f; expectedquat.z = -5.0f; expectedquat.w = 0.0f;
1592  D3DXQuaternionLn(&gotquat,&r);
1593  expect_quaternion(&expectedquat, &gotquat, 0);
1594  Nq.x = 1.0f/11.0f; Nq.y = 2.0f/11.0f; Nq.z = 4.0f/11.0f; Nq.w=10.0f/11.0f;
1595  expectedquat.x = 0.093768f; expectedquat.y = 0.187536f; expectedquat.z = 0.375073f; expectedquat.w = 0.0f;
1596  D3DXQuaternionLn(&gotquat,&Nq);
1597  expect_quaternion(&expectedquat, &gotquat, 32);
1598  Nq.x = 0.0f; Nq.y = 0.0f; Nq.z = 0.0f; Nq.w = 1.0f;
1599  expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f;
1600  D3DXQuaternionLn(&gotquat,&Nq);
1601  expect_quaternion(&expectedquat, &gotquat, 0);
1602  Nq.x = 5.4f; Nq.y = 1.2f; Nq.z = -0.3f; Nq.w = -0.3f;
1603  expectedquat.x = 10.616652f; expectedquat.y = 2.359256f; expectedquat.z = -0.589814f; expectedquat.w = 0.0f;
1604  D3DXQuaternionLn(&gotquat,&Nq);
1605  expect_quaternion(&expectedquat, &gotquat, 1);
1606  /* Test the case where the norm of the quaternion is <1 */
1607  Nq1.x = 0.2f; Nq1.y = 0.1f; Nq1.z = 0.3; Nq1.w = 0.9f;
1608  expectedquat.x = 0.206945f; expectedquat.y = 0.103473f; expectedquat.z = 0.310418f; expectedquat.w = 0.0f;
1609  D3DXQuaternionLn(&gotquat,&Nq1);
1610  expect_quaternion(&expectedquat, &gotquat, 64);
1611  /* Test the case where the real part of the quaternion is -1.0f */
1612  Nq1.x = 0.2f; Nq1.y = 0.1f; Nq1.z = 0.3; Nq1.w = -1.0f;
1613  expectedquat.x = 0.2f; expectedquat.y = 0.1f; expectedquat.z = 0.3f; expectedquat.w = 0.0f;
1614  D3DXQuaternionLn(&gotquat,&Nq1);
1615  expect_quaternion(&expectedquat, &gotquat, 0);
1616 
1617 /*_______________D3DXQuaternionMultiply________________________*/
1618  expectedquat.x = 3.0f; expectedquat.y = 61.0f; expectedquat.z = -32.0f; expectedquat.w = 85.0f;
1619  D3DXQuaternionMultiply(&gotquat,&q,&r);
1620  expect_quaternion(&expectedquat, &gotquat, 0);
1621 
1622 /*_______________D3DXQuaternionNormalize________________________*/
1623  expectedquat.x = 1.0f/11.0f; expectedquat.y = 2.0f/11.0f; expectedquat.z = 4.0f/11.0f; expectedquat.w = 10.0f/11.0f;
1624  D3DXQuaternionNormalize(&gotquat,&q);
1625  expect_quaternion(&expectedquat, &gotquat, 1);
1626 
1627 /*_______________D3DXQuaternionRotationAxis___________________*/
1628  axis.x = 2.0f; axis.y = 7.0; axis.z = 13.0f;
1629  angle = D3DX_PI/3.0f;
1630  expectedquat.x = 0.067116; expectedquat.y = 0.234905f; expectedquat.z = 0.436251f; expectedquat.w = 0.866025f;
1631  D3DXQuaternionRotationAxis(&gotquat,&axis,angle);
1632  expect_quaternion(&expectedquat, &gotquat, 64);
1633  /* Test the nul quaternion */
1634  axis.x = 0.0f; axis.y = 0.0; axis.z = 0.0f;
1635  expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.866025f;
1636  D3DXQuaternionRotationAxis(&gotquat,&axis,angle);
1637  expect_quaternion(&expectedquat, &gotquat, 8);
1638 
1639 /*_______________D3DXQuaternionRotationMatrix___________________*/
1640  /* test when the trace is >0 */
1641  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1642  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1643  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1644  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1645  U(mat).m[0][0] = 10.0f; U(mat).m[1][1] = 20.0f; U(mat).m[2][2] = 30.0f;
1646  U(mat).m[3][3] = 48.0f;
1647  expectedquat.x = 2.368682f; expectedquat.y = 0.768221f; expectedquat.z = -0.384111f; expectedquat.w = 3.905125f;
1648  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1649  expect_quaternion(&expectedquat, &gotquat, 16);
1650  /* test the case when the greater element is (2,2) */
1651  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1652  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1653  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1654  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1655  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = -60.0f; U(mat).m[2][2] = 40.0f;
1656  U(mat).m[3][3] = 48.0f;
1657  expectedquat.x = 1.233905f; expectedquat.y = -0.237290f; expectedquat.z = 5.267827f; expectedquat.w = -0.284747f;
1658  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1659  expect_quaternion(&expectedquat, &gotquat, 64);
1660  /* test the case when the greater element is (1,1) */
1661  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1662  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1663  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1664  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1665  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 60.0f; U(mat).m[2][2] = -80.0f;
1666  U(mat).m[3][3] = 48.0f;
1667  expectedquat.x = 0.651031f; expectedquat.y = 6.144103f; expectedquat.z = -0.203447f; expectedquat.w = 0.488273f;
1668  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1669  expect_quaternion(&expectedquat, &gotquat, 8);
1670  /* test the case when the trace is near 0 in a matrix which is not a rotation */
1671  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1672  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1673  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1674  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1675  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = -0.9f;
1676  U(mat).m[3][3] = 48.0f;
1677  expectedquat.x = 1.709495f; expectedquat.y = 2.339872f; expectedquat.z = -0.534217f; expectedquat.w = 1.282122f;
1678  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1679  expect_quaternion(&expectedquat, &gotquat, 8);
1680  /* test the case when the trace is 0.49 in a matrix which is not a rotation */
1681  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1682  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1683  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1684  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1685  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = -0.51f;
1686  U(mat).m[3][3] = 48.0f;
1687  expectedquat.x = 1.724923f; expectedquat.y = 2.318944f; expectedquat.z = -0.539039f; expectedquat.w = 1.293692f;
1688  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1689  expect_quaternion(&expectedquat, &gotquat, 8);
1690  /* test the case when the trace is 0.51 in a matrix which is not a rotation */
1691  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1692  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1693  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1694  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1695  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = -0.49f;
1696  U(mat).m[3][3] = 48.0f;
1697  expectedquat.x = 1.725726f; expectedquat.y = 2.317865f; expectedquat.z = -0.539289f; expectedquat.w = 1.294294f;
1698  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1699  expect_quaternion(&expectedquat, &gotquat, 8);
1700  /* test the case when the trace is 0.99 in a matrix which is not a rotation */
1701  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1702  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1703  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1704  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1705  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = -0.01f;
1706  U(mat).m[3][3] = 48.0f;
1707  expectedquat.x = 1.745328f; expectedquat.y = 2.291833f; expectedquat.z = -0.545415f; expectedquat.w = 1.308996f;
1708  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1709  expect_quaternion(&expectedquat, &gotquat, 4);
1710  /* test the case when the trace is 1.0 in a matrix which is not a rotation */
1711  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1712  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1713  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1714  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1715  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = 0.0f;
1716  U(mat).m[3][3] = 48.0f;
1717  expectedquat.x = 1.745743f; expectedquat.y = 2.291288f; expectedquat.z = -0.545545f; expectedquat.w = 1.309307f;
1718  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1719  expect_quaternion(&expectedquat, &gotquat, 8);
1720  /* test the case when the trace is 1.01 in a matrix which is not a rotation */
1721  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1722  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1723  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1724  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1725  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = 0.01f;
1726  U(mat).m[3][3] = 48.0f;
1727  expectedquat.x = 18.408188f; expectedquat.y = 5.970223f; expectedquat.z = -2.985111f; expectedquat.w = 0.502494f;
1728  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1729  expect_quaternion(&expectedquat, &gotquat, 4);
1730  /* test the case when the trace is 1.5 in a matrix which is not a rotation */
1731  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1732  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1733  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1734  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1735  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = 0.5f;
1736  U(mat).m[3][3] = 48.0f;
1737  expectedquat.x = 15.105186f; expectedquat.y = 4.898980f; expectedquat.z = -2.449490f; expectedquat.w = 0.612372f;
1738  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1739  expect_quaternion(&expectedquat, &gotquat, 8);
1740  /* test the case when the trace is 1.7 in a matrix which is not a rotation */
1741  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1742  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1743  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1744  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1745  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = 0.70f;
1746  U(mat).m[3][3] = 48.0f;
1747  expectedquat.x = 14.188852f; expectedquat.y = 4.601790f; expectedquat.z = -2.300895f; expectedquat.w = 0.651920f;
1748  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1749  expect_quaternion(&expectedquat, &gotquat, 4);
1750  /* test the case when the trace is 1.99 in a matrix which is not a rotation */
1751  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1752  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1753  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1754  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1755  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = 0.99f;
1756  U(mat).m[3][3] = 48.0f;
1757  expectedquat.x = 13.114303f; expectedquat.y = 4.253287f; expectedquat.z = -2.126644f; expectedquat.w = 0.705337f;
1758  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1759  expect_quaternion(&expectedquat, &gotquat, 4);
1760  /* test the case when the trace is 2.0 in a matrix which is not a rotation */
1761  U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f;
1762  U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f;
1763  U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f;
1764  U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f;
1765  U(mat).m[0][0] = -10.0f; U(mat).m[1][1] = 10.0f; U(mat).m[2][2] = 2.0f;
1766  U(mat).m[3][3] = 48.0f;
1767  expectedquat.x = 10.680980f; expectedquat.y = 3.464102f; expectedquat.z = -1.732051f; expectedquat.w = 0.866025f;
1768  D3DXQuaternionRotationMatrix(&gotquat,&mat);
1769  expect_quaternion(&expectedquat, &gotquat, 8);
1770 
1771 /*_______________D3DXQuaternionRotationYawPitchRoll__________*/
1772  expectedquat.x = 0.303261f; expectedquat.y = 0.262299f; expectedquat.z = 0.410073f; expectedquat.w = 0.819190f;
1774  expect_quaternion(&expectedquat, &gotquat, 16);
1775 
1776 /*_______________D3DXQuaternionSlerp________________________*/
1777  expectedquat.x = -0.2f; expectedquat.y = 2.6f; expectedquat.z = 1.3f; expectedquat.w = 9.1f;
1778  D3DXQuaternionSlerp(&gotquat,&q,&r,scale);
1779  expect_quaternion(&expectedquat, &gotquat, 4);
1780  expectedquat.x = 334.0f; expectedquat.y = -31.9f; expectedquat.z = 6.1f; expectedquat.w = 6.7f;
1781  D3DXQuaternionSlerp(&gotquat,&q,&t,scale);
1782  expect_quaternion(&expectedquat, &gotquat, 2);
1783  expectedquat.x = 0.239485f; expectedquat.y = 0.346580f; expectedquat.z = 0.453676f; expectedquat.w = 0.560772f;
1784  D3DXQuaternionSlerp(&gotquat,&smallq,&smallr,scale);
1785  expect_quaternion(&expectedquat, &gotquat, 32);
1786 
1787 /*_______________D3DXQuaternionSquad________________________*/
1788  expectedquat.x = -156.296f; expectedquat.y = 30.242f; expectedquat.z = -2.5022f; expectedquat.w = 7.3576f;
1789  D3DXQuaternionSquad(&gotquat,&q,&r,&t,&u,scale);
1790  expect_quaternion(&expectedquat, &gotquat, 2);
1791 
1792 /*_______________D3DXQuaternionSquadSetup___________________*/
1793  r.x = 1.0f, r.y = 2.0f; r.z = 4.0f; r.w = 10.0f;
1794  s.x = -3.0f; s.y = 4.0f; s.z = -5.0f; s.w = 7.0;
1795  t.x = -1111.0f, t.y = 111.0f; t.z = -11.0f; t.w = 1.0f;
1796  u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f;
1797  D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &t, &u);
1798  expectedquat.x = 7.121285f; expectedquat.y = 2.159964f; expectedquat.z = -3.855094f; expectedquat.w = 5.362844f;
1799  expect_quaternion(&expectedquat, &gotquat, 2);
1800  expectedquat.x = -1113.492920f; expectedquat.y = 82.679260f; expectedquat.z = -6.696645f; expectedquat.w = -4.090050f;
1801  expect_quaternion(&expectedquat, &Nq, 4);
1802  expectedquat.x = -1111.0f; expectedquat.y = 111.0f; expectedquat.z = -11.0f; expectedquat.w = 1.0f;
1803  expect_quaternion(&expectedquat, &Nq1, 0);
1804  gotquat = s;
1805  D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &gotquat, &t, &u);
1806  expectedquat.x = -1113.492920f; expectedquat.y = 82.679260f; expectedquat.z = -6.696645f; expectedquat.w = -4.090050f;
1807  expect_quaternion(&expectedquat, &Nq, 4);
1808  Nq1 = u;
1809  D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &t, &Nq1);
1810  expect_quaternion(&expectedquat, &Nq, 4);
1811  r.x = 0.2f; r.y = 0.3f; r.z = 1.3f; r.w = -0.6f;
1812  s.x = -3.0f; s.y =-2.0f; s.z = 4.0f; s.w = 0.2f;
1813  t.x = 0.4f; t.y = 8.3f; t.z = -3.1f; t.w = -2.7f;
1814  u.x = 1.1f; u.y = -0.7f; u.z = 9.2f; u.w = 0.0f;
1815  D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &u, &t);
1816  expectedquat.x = -4.139569f; expectedquat.y = -2.469115f; expectedquat.z = 2.364477f; expectedquat.w = 0.465494f;
1817  expect_quaternion(&expectedquat, &gotquat, 16);
1818  expectedquat.x = 2.342533f; expectedquat.y = 2.365127f; expectedquat.z = 8.628538f; expectedquat.w = -0.898356f;
1819  expect_quaternion(&expectedquat, &Nq, 16);
1820  expectedquat.x = 1.1f; expectedquat.y = -0.7f; expectedquat.z = 9.2f; expectedquat.w = 0.0f;
1821  expect_quaternion(&expectedquat, &Nq1, 0);
1822  D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &t, &u);
1823  expectedquat.x = -3.754567f; expectedquat.y = -0.586085f; expectedquat.z = 3.815818f; expectedquat.w = -0.198150f;
1824  expect_quaternion(&expectedquat, &gotquat, 32);
1825  expectedquat.x = 0.140773f; expectedquat.y = -8.737090f; expectedquat.z = -0.516593f; expectedquat.w = 3.053942f;
1826  expect_quaternion(&expectedquat, &Nq, 16);
1827  expectedquat.x = -0.4f; expectedquat.y = -8.3f; expectedquat.z = 3.1f; expectedquat.w = 2.7f;
1828  expect_quaternion(&expectedquat, &Nq1, 0);
1829  r.x = -1.0f; r.y = 0.0f; r.z = 0.0f; r.w = 0.0f;
1830  s.x = 1.0f; s.y =0.0f; s.z = 0.0f; s.w = 0.0f;
1831  t.x = 1.0f; t.y = 0.0f; t.z = 0.0f; t.w = 0.0f;
1832  u.x = -1.0f; u.y = 0.0f; u.z = 0.0f; u.w = 0.0f;
1833  D3DXQuaternionSquadSetup(&gotquat, &Nq, &Nq1, &r, &s, &t, &u);
1834  expectedquat.x = 1.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f;
1835  expect_quaternion(&expectedquat, &gotquat, 0);
1836  expectedquat.x = 1.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f;
1837  expect_quaternion(&expectedquat, &Nq, 0);
1838  expectedquat.x = 1.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f;
1839  expect_quaternion(&expectedquat, &Nq1, 0);
1840 
1841 /*_______________D3DXQuaternionToAxisAngle__________________*/
1842  Nq.x = 1.0f/22.0f; Nq.y = 2.0f/22.0f; Nq.z = 4.0f/22.0f; Nq.w = 10.0f/22.0f;
1843  expectedvec.x = 1.0f/22.0f; expectedvec.y = 2.0f/22.0f; expectedvec.z = 4.0f/22.0f;
1844  D3DXQuaternionToAxisAngle(&Nq,&axis,&angle);
1845  expect_vec3(&expectedvec, &axis, 0);
1846  equal = compare_float(angle, 2.197869f, 1);
1847  ok(equal, "Got unexpected angle %.8e.\n", angle);
1848  /* Test if |w|>1.0f */
1849  expectedvec.x = 1.0f; expectedvec.y = 2.0f; expectedvec.z = 4.0f;
1851  expect_vec3(&expectedvec, &axis, 0);
1852  /* Test the null quaternion */
1853  expectedvec.x = 0.0f; expectedvec.y = 0.0f; expectedvec.z = 0.0f;
1854  D3DXQuaternionToAxisAngle(&nul, &axis, &angle);
1855  expect_vec3(&expectedvec, &axis, 0);
1856  equal = compare_float(angle, 3.14159274e+00f, 0);
1857  ok(equal, "Got unexpected angle %.8e.\n", angle);
1858 
1859  D3DXQuaternionToAxisAngle(&nul, &axis, NULL);
1861  expect_vec3(&expectedvec, &axis, 0);
1862  equal = compare_float(angle, 3.14159274e+00f, 0);
1863  ok(equal, "Got unexpected angle %.8e.\n", angle);
1864 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
D3DXQUATERNION *WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, const D3DXQUATERNION *pq3, FLOAT f, FLOAT g)
Definition: math.c:1304
#define expect_quaternion(expected, quaternion, ulps)
Definition: math.c:147
#define TRUE
Definition: types.h:120
D3DXQUATERNION *WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, const D3DXQUATERNION *pq3, const D3DXQUATERNION *pq4, FLOAT t)
Definition: math.c:1527
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define U(x)
Definition: wordpad.c:45
#define equal(x, y)
Definition: reader.cc:56
GLdouble GLdouble t
Definition: gl.h:2047
static const MAT2 mat
Definition: font.c:66
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
GLfloat angle
Definition: glext.h:10853
D3DXQUATERNION *WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *out, const D3DXVECTOR3 *v, FLOAT angle)
Definition: math.c:1403
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define e
Definition: ke_i.h:82
smooth NULL
Definition: ftsmooth.c:416
#define expect_vec3(expected, vector, ulps)
Definition: math.c:111
GLfloat f
Definition: glext.h:7540
D3DXQUATERNION *WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, const D3DXQUATERNION *pq)
Definition: math.c:1339
D3DXQUATERNION *WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *out, const D3DXMATRIX *m)
Definition: math.c:1419
D3DXQUATERNION *WINAPI D3DXQuaternionLn(D3DXQUATERNION *out, const D3DXQUATERNION *q)
Definition: math.c:1354
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
D3DXQUATERNION *WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *out, const D3DXQUATERNION *q)
Definition: math.c:1387
GLdouble s
Definition: gl.h:2039
void WINAPI D3DXQuaternionToAxisAngle(const D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle)
Definition: math.c:1605
D3DXQUATERNION *WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *out, const D3DXQUATERNION *q1, const D3DXQUATERNION *q2, FLOAT t)
Definition: math.c:1496
D3DXQUATERNION *WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2)
Definition: math.c:1373
#define ok(value,...)
Definition: atltest.h:57
void WINAPI D3DXQuaternionSquadSetup(D3DXQUATERNION *paout, D3DXQUATERNION *pbout, D3DXQUATERNION *pcout, const D3DXQUATERNION *pq0, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, const D3DXQUATERNION *pq3)
Definition: math.c:1549
#define D3DX_PI
Definition: d3dx9math.h:27
D3DXQUATERNION *WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *out, FLOAT yaw, FLOAT pitch, FLOAT roll)
Definition: math.c:1475
D3DXQUATERNION *WINAPI D3DXQuaternionExp(D3DXQUATERNION *out, const D3DXQUATERNION *q)
Definition: math.c:1314

Referenced by START_TEST().

◆ D3DXVector2Test()

static void D3DXVector2Test ( void  )
static

Definition at line 1866 of file math.c.

1867 {
1868  D3DXVECTOR2 expectedvec, gotvec, nul, u, v, w, x;
1869  LPD3DXVECTOR2 funcpointer;
1870  D3DXVECTOR4 expectedtrans, gottrans;
1871  float coeff1, coeff2, got, scale;
1872  D3DXMATRIX mat;
1873  BOOL equal;
1874 
1875  nul.x = 0.0f; nul.y = 0.0f;
1876  u.x = 3.0f; u.y = 4.0f;
1877  v.x = -7.0f; v.y = 9.0f;
1878  w.x = 4.0f; w.y = -3.0f;
1879  x.x = 2.0f; x.y = -11.0f;
1880 
1881  set_matrix(&mat,
1882  1.0f, 2.0f, 3.0f, 4.0f,
1883  5.0f, 6.0f, 7.0f, 8.0f,
1884  9.0f, 10.0f, 11.0f, 12.0f,
1885  13.0f, 14.0f, 15.0f, 16.0f);
1886 
1887  coeff1 = 2.0f; coeff2 = 5.0f;
1888  scale = -6.5f;
1889 
1890 /*_______________D3DXVec2Add__________________________*/
1891  expectedvec.x = -4.0f; expectedvec.y = 13.0f;
1892  D3DXVec2Add(&gotvec,&u,&v);
1893  expect_vec2(&expectedvec, &gotvec, 0);
1894  /* Tests the case NULL */
1895  funcpointer = D3DXVec2Add(&gotvec,NULL,&v);
1896  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1897  funcpointer = D3DXVec2Add(NULL,NULL,NULL);
1898  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1899 
1900 /*_______________D3DXVec2BaryCentric___________________*/
1901  expectedvec.x = -12.0f; expectedvec.y = -21.0f;
1902  D3DXVec2BaryCentric(&gotvec,&u,&v,&w,coeff1,coeff2);
1903  expect_vec2(&expectedvec, &gotvec, 0);
1904 
1905 /*_______________D3DXVec2CatmullRom____________________*/
1906  expectedvec.x = 5820.25f; expectedvec.y = -3654.5625f;
1907  D3DXVec2CatmullRom(&gotvec,&u,&v,&w,&x,scale);
1908  expect_vec2(&expectedvec, &gotvec, 0);
1909 
1910 /*_______________D3DXVec2CCW__________________________*/
1911  got = D3DXVec2CCW(&u, &v);
1912  equal = compare_float(got, 55.0f, 0);
1913  ok(equal, "Got unexpected ccw %.8e.\n", got);
1914  /* Tests the case NULL. */
1915  got = D3DXVec2CCW(NULL, &v);
1916  equal = compare_float(got, 0.0f, 0);
1917  ok(equal, "Got unexpected ccw %.8e.\n", got);
1918  got = D3DXVec2CCW(NULL, NULL);
1919  equal = compare_float(got, 0.0f, 0);
1920  ok(equal, "Got unexpected ccw %.8e.\n", got);
1921 
1922 /*_______________D3DXVec2Dot__________________________*/
1923  got = D3DXVec2Dot(&u, &v);
1924  equal = compare_float(got, 15.0f, 0);
1925  ok(equal, "Got unexpected dot %.8e.\n", got);
1926  /* Tests the case NULL */
1927  got = D3DXVec2Dot(NULL, &v);
1928  equal = compare_float(got, 0.0f, 0);
1929  ok(equal, "Got unexpected dot %.8e.\n", got);
1930  got = D3DXVec2Dot(NULL, NULL);
1931  equal = compare_float(got, 0.0f, 0);
1932  ok(equal, "Got unexpected dot %.8e.\n", got);
1933 
1934 /*_______________D3DXVec2Hermite__________________________*/
1935  expectedvec.x = 2604.625f; expectedvec.y = -4533.0f;
1936  D3DXVec2Hermite(&gotvec,&u,&v,&w,&x,scale);
1937  expect_vec2(&expectedvec, &gotvec, 0);
1938 
1939 /*_______________D3DXVec2Length__________________________*/
1940  got = D3DXVec2Length(&u);
1941  equal = compare_float(got, 5.0f, 0);
1942  ok(equal, "Got unexpected length %.8e.\n", got);
1943  /* Tests the case NULL. */
1944  got = D3DXVec2Length(NULL);
1945  equal = compare_float(got, 0.0f, 0);
1946  ok(equal, "Got unexpected length %.8e.\n", got);
1947 
1948 /*_______________D3DXVec2LengthSq________________________*/
1949  got = D3DXVec2LengthSq(&u);
1950  equal = compare_float(got, 25.0f, 0);
1951  ok(equal, "Got unexpected length %.8e.\n", got);
1952  /* Tests the case NULL. */
1953  got = D3DXVec2LengthSq(NULL);
1954  equal = compare_float(got, 0.0f, 0);
1955  ok(equal, "Got unexpected length %.8e.\n", got);
1956 
1957 /*_______________D3DXVec2Lerp__________________________*/
1958  expectedvec.x = 68.0f; expectedvec.y = -28.5f;
1959  D3DXVec2Lerp(&gotvec, &u, &v, scale);
1960  expect_vec2(&expectedvec, &gotvec, 0);
1961  /* Tests the case NULL. */
1962  funcpointer = D3DXVec2Lerp(&gotvec,NULL,&v,scale);
1963  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1964  funcpointer = D3DXVec2Lerp(NULL,NULL,NULL,scale);
1965  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1966 
1967 /*_______________D3DXVec2Maximize__________________________*/
1968  expectedvec.x = 3.0f; expectedvec.y = 9.0f;
1969  D3DXVec2Maximize(&gotvec, &u, &v);
1970  expect_vec2(&expectedvec, &gotvec, 0);
1971  /* Tests the case NULL. */
1972  funcpointer = D3DXVec2Maximize(&gotvec,NULL,&v);
1973  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1974  funcpointer = D3DXVec2Maximize(NULL,NULL,NULL);
1975  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1976 
1977 /*_______________D3DXVec2Minimize__________________________*/
1978  expectedvec.x = -7.0f; expectedvec.y = 4.0f;
1979  D3DXVec2Minimize(&gotvec,&u,&v);
1980  expect_vec2(&expectedvec, &gotvec, 0);
1981  /* Tests the case NULL */
1982  funcpointer = D3DXVec2Minimize(&gotvec,NULL,&v);
1983  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1984  funcpointer = D3DXVec2Minimize(NULL,NULL,NULL);
1985  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
1986 
1987 /*_______________D3DXVec2Normalize_________________________*/
1988  expectedvec.x = 0.6f; expectedvec.y = 0.8f;
1989  D3DXVec2Normalize(&gotvec,&u);
1990  expect_vec2(&expectedvec, &gotvec, 0);
1991  /* Test the nul vector */
1992  expectedvec.x = 0.0f; expectedvec.y = 0.0f;
1993  D3DXVec2Normalize(&gotvec,&nul);
1994  expect_vec2(&expectedvec, &gotvec, 0);
1995 
1996 /*_______________D3DXVec2Scale____________________________*/
1997  expectedvec.x = -19.5f; expectedvec.y = -26.0f;
1998  D3DXVec2Scale(&gotvec,&u,scale);
1999  expect_vec2(&expectedvec, &gotvec, 0);
2000  /* Tests the case NULL */
2001  funcpointer = D3DXVec2Scale(&gotvec,NULL,scale);
2002  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2003  funcpointer = D3DXVec2Scale(NULL,NULL,scale);
2004  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2005 
2006 /*_______________D3DXVec2Subtract__________________________*/
2007  expectedvec.x = 10.0f; expectedvec.y = -5.0f;
2008  D3DXVec2Subtract(&gotvec, &u, &v);
2009  expect_vec2(&expectedvec, &gotvec, 0);
2010  /* Tests the case NULL. */
2011  funcpointer = D3DXVec2Subtract(&gotvec,NULL,&v);
2012  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2013  funcpointer = D3DXVec2Subtract(NULL,NULL,NULL);
2014  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2015 
2016 /*_______________D3DXVec2Transform_______________________*/
2017  expectedtrans.x = 36.0f; expectedtrans.y = 44.0f; expectedtrans.z = 52.0f; expectedtrans.w = 60.0f;
2018  D3DXVec2Transform(&gottrans, &u, &mat);
2019  expect_vec4(&expectedtrans, &gottrans, 0);
2020  gottrans.x = u.x; gottrans.y = u.y;
2021  D3DXVec2Transform(&gottrans, (D3DXVECTOR2 *)&gottrans, &mat);
2022  expect_vec4(&expectedtrans, &gottrans, 0);
2023 
2024 /*_______________D3DXVec2TransformCoord_______________________*/
2025  expectedvec.x = 0.6f; expectedvec.y = 11.0f/15.0f;
2026  D3DXVec2TransformCoord(&gotvec, &u, &mat);
2027  expect_vec2(&expectedvec, &gotvec, 1);
2028  gotvec.x = u.x; gotvec.y = u.y;
2029  D3DXVec2TransformCoord(&gotvec, (D3DXVECTOR2 *)&gotvec, &mat);
2030  expect_vec2(&expectedvec, &gotvec, 1);
2031 
2032  /*_______________D3DXVec2TransformNormal______________________*/
2033  expectedvec.x = 23.0f; expectedvec.y = 30.0f;
2034  D3DXVec2TransformNormal(&gotvec,&u,&mat);
2035  expect_vec2(&expectedvec, &gotvec, 0);
2036 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
D3DXVECTOR2 *WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2, const D3DXVECTOR2 *pv3, FLOAT f, FLOAT g)
Definition: math.c:1621
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
FLOAT y
Definition: d3dx9math.h:64
static void set_matrix(D3DXMATRIX *mat, float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
Definition: math.c:196
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define equal(x, y)
Definition: reader.cc:56
D3DXVECTOR4 *WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, const D3DXVECTOR2 *pv, const D3DXMATRIX *pm)
Definition: math.c:1676
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static const MAT2 mat
Definition: font.c:66
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
#define expect_vec4(expected, vector, ulps)
Definition: math.c:120
#define expect_vec2(expected, vector, ulps)
Definition: math.c:102
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
D3DXVECTOR2 *WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv)
Definition: math.c:1655
D3DXVECTOR2 *WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv, const D3DXMATRIX *pm)
Definition: math.c:1705
GLfloat f
Definition: glext.h:7540
FLOAT x
Definition: d3dx9math.h:64
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
D3DXVECTOR2 *WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv, const D3DXMATRIX *pm)
Definition: math.c:1736
D3DXVECTOR2 *WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv0, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2, const D3DXVECTOR2 *pv3, FLOAT s)
Definition: math.c:1630
D3DXVECTOR2 *WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pt1, const D3DXVECTOR2 *pv2, const D3DXVECTOR2 *pt2, FLOAT s)
Definition: math.c:1639

Referenced by START_TEST().

◆ D3DXVector3Test()

static void D3DXVector3Test ( void  )
static

Definition at line 2038 of file math.c.

2039 {
2040  D3DVIEWPORT9 viewport;
2041  D3DXVECTOR3 expectedvec, gotvec, nul, u, v, w, x;
2042  LPD3DXVECTOR3 funcpointer;
2043  D3DXVECTOR4 expectedtrans, gottrans;
2044  D3DXMATRIX mat, projection, view, world;
2045  float coeff1, coeff2, got, scale;
2046  BOOL equal;
2047 
2048  nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f;
2049  u.x = 9.0f; u.y = 6.0f; u.z = 2.0f;
2050  v.x = 2.0f; v.y = -3.0f; v.z = -4.0;
2051  w.x = 3.0f; w.y = -5.0f; w.z = 7.0f;
2052  x.x = 4.0f; x.y = 1.0f; x.z = 11.0f;
2053 
2054  viewport.Width = 800; viewport.MinZ = 0.2f; viewport.X = 10;
2055  viewport.Height = 680; viewport.MaxZ = 0.9f; viewport.Y = 5;
2056 
2057  set_matrix(&mat,
2058  1.0f, 2.0f, 3.0f, 4.0f,
2059  5.0f, 6.0f, 7.0f, 8.0f,
2060  9.0f, 10.0f, 11.0f, 12.0f,
2061  13.0f, 14.0f, 15.0f, 16.0f);
2062 
2063  U(view).m[0][1] = 5.0f; U(view).m[0][2] = 7.0f; U(view).m[0][3] = 8.0f;
2064  U(view).m[1][0] = 11.0f; U(view).m[1][2] = 16.0f; U(view).m[1][3] = 33.0f;
2065  U(view).m[2][0] = 19.0f; U(view).m[2][1] = -21.0f; U(view).m[2][3] = 43.0f;
2066  U(view).m[3][0] = 2.0f; U(view).m[3][1] = 3.0f; U(view).m[3][2] = -4.0f;
2067  U(view).m[0][0] = 10.0f; U(view).m[1][1] = 20.0f; U(view).m[2][2] = 30.0f;
2068  U(view).m[3][3] = -40.0f;
2069 
2070  set_matrix(&world,
2071  21.0f, 2.0f, 3.0f, 4.0f,
2072  5.0f, 23.0f, 7.0f, 8.0f,
2073  -8.0f, -7.0f, 25.0f, -5.0f,
2074  -4.0f, -3.0f, -2.0f, 27.0f);
2075 
2076  coeff1 = 2.0f; coeff2 = 5.0f;
2077  scale = -6.5f;
2078 
2079 /*_______________D3DXVec3Add__________________________*/
2080  expectedvec.x = 11.0f; expectedvec.y = 3.0f; expectedvec.z = -2.0f;
2081  D3DXVec3Add(&gotvec,&u,&v);
2082  expect_vec3(&expectedvec, &gotvec, 0);
2083  /* Tests the case NULL */
2084  funcpointer = D3DXVec3Add(&gotvec,NULL,&v);
2085  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2086  funcpointer = D3DXVec3Add(NULL,NULL,NULL);
2087  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2088 
2089 /*_______________D3DXVec3BaryCentric___________________*/
2090  expectedvec.x = -35.0f; expectedvec.y = -67.0; expectedvec.z = 15.0f;
2091  D3DXVec3BaryCentric(&gotvec,&u,&v,&w,coeff1,coeff2);
2092  expect_vec3(&expectedvec, &gotvec, 0);
2093 
2094 /*_______________D3DXVec3CatmullRom____________________*/
2095  expectedvec.x = 1458.0f; expectedvec.y = 22.1875f; expectedvec.z = 4141.375f;
2096  D3DXVec3CatmullRom(&gotvec,&u,&v,&w,&x,scale);
2097  expect_vec3(&expectedvec, &gotvec, 0);
2098 
2099 /*_______________D3DXVec3Cross________________________*/
2100  expectedvec.x = -18.0f; expectedvec.y = 40.0f; expectedvec.z = -39.0f;
2101  D3DXVec3Cross(&gotvec,&u,&v);
2102  expect_vec3(&expectedvec, &gotvec, 0);
2103  expectedvec.x = -277.0f; expectedvec.y = -150.0f; expectedvec.z = -26.0f;
2104  D3DXVec3Cross(&gotvec,&gotvec,&v);
2105  expect_vec3(&expectedvec, &gotvec, 0);
2106  /* Tests the case NULL */
2107  funcpointer = D3DXVec3Cross(&gotvec,NULL,&v);
2108  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2109  funcpointer = D3DXVec3Cross(NULL,NULL,NULL);
2110  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2111 
2112 /*_______________D3DXVec3Dot__________________________*/
2113  got = D3DXVec3Dot(&u, &v);
2114  equal = compare_float(got, -8.0f, 0);
2115  ok(equal, "Got unexpected dot %.8e.\n", got);
2116  /* Tests the case NULL */
2117  got = D3DXVec3Dot(NULL, &v);
2118  equal = compare_float(got, 0.0f, 0);
2119  ok(equal, "Got unexpected dot %.8e.\n", got);
2120  got = D3DXVec3Dot(NULL, NULL);
2121  equal = compare_float(got, 0.0f, 0);
2122  ok(equal, "Got unexpected dot %.8e.\n", got);
2123 
2124 /*_______________D3DXVec3Hermite__________________________*/
2125  expectedvec.x = -6045.75f; expectedvec.y = -6650.0f; expectedvec.z = 1358.875f;
2126  D3DXVec3Hermite(&gotvec,&u,&v,&w,&x,scale);
2127  expect_vec3(&expectedvec, &gotvec, 0);
2128 
2129 /*_______________D3DXVec3Length__________________________*/
2130  got = D3DXVec3Length(&u);
2131  equal = compare_float(got, 11.0f, 0);
2132  ok(equal, "Got unexpected length %.8e.\n", got);
2133  /* Tests the case NULL. */
2134  got = D3DXVec3Length(NULL);
2135  equal = compare_float(got, 0.0f, 0);
2136  ok(equal, "Got unexpected length %.8e.\n", got);
2137 
2138 /*_______________D3DXVec3LengthSq________________________*/
2139  got = D3DXVec3LengthSq(&u);
2140  equal = compare_float(got, 121.0f, 0);
2141  ok(equal, "Got unexpected length %.8e.\n", got);
2142  /* Tests the case NULL. */
2143  got = D3DXVec3LengthSq(NULL);
2144  equal = compare_float(got, 0.0f, 0);
2145  ok(equal, "Got unexpected length %.8e.\n", got);
2146 
2147 /*_______________D3DXVec3Lerp__________________________*/
2148  expectedvec.x = 54.5f; expectedvec.y = 64.5f, expectedvec.z = 41.0f ;
2149  D3DXVec3Lerp(&gotvec,&u,&v,scale);
2150  expect_vec3(&expectedvec, &gotvec, 0);
2151  /* Tests the case NULL */
2152  funcpointer = D3DXVec3Lerp(&gotvec,NULL,&v,scale);
2153  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2154  funcpointer = D3DXVec3Lerp(NULL,NULL,NULL,scale);
2155  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2156 
2157 /*_______________D3DXVec3Maximize__________________________*/
2158  expectedvec.x = 9.0f; expectedvec.y = 6.0f; expectedvec.z = 2.0f;
2159  D3DXVec3Maximize(&gotvec,&u,&v);
2160  expect_vec3(&expectedvec, &gotvec, 0);
2161  /* Tests the case NULL */
2162  funcpointer = D3DXVec3Maximize(&gotvec,NULL,&v);
2163  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2164  funcpointer = D3DXVec3Maximize(NULL,NULL,NULL);
2165  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2166 
2167 /*_______________D3DXVec3Minimize__________________________*/
2168  expectedvec.x = 2.0f; expectedvec.y = -3.0f; expectedvec.z = -4.0f;
2169  D3DXVec3Minimize(&gotvec,&u,&v);
2170  expect_vec3(&expectedvec, &gotvec, 0);
2171  /* Tests the case NULL */
2172  funcpointer = D3DXVec3Minimize(&gotvec,NULL,&v);
2173  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2174  funcpointer = D3DXVec3Minimize(NULL,NULL,NULL);
2175  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2176 
2177 /*_______________D3DXVec3Normalize_________________________*/
2178  expectedvec.x = 9.0f/11.0f; expectedvec.y = 6.0f/11.0f; expectedvec.z = 2.0f/11.0f;
2179  D3DXVec3Normalize(&gotvec,&u);
2180  expect_vec3(&expectedvec, &gotvec, 1);
2181  /* Test the nul vector */
2182  expectedvec.x = 0.0f; expectedvec.y = 0.0f; expectedvec.z = 0.0f;
2183  D3DXVec3Normalize(&gotvec,&nul);
2184  expect_vec3(&expectedvec, &gotvec, 0);
2185 
2186 /*_______________D3DXVec3Scale____________________________*/
2187  expectedvec.x = -58.5f; expectedvec.y = -39.0f; expectedvec.z = -13.0f;
2188  D3DXVec3Scale(&gotvec,&u,scale);
2189  expect_vec3(&expectedvec, &gotvec, 0);
2190  /* Tests the case NULL */
2191  funcpointer = D3DXVec3Scale(&gotvec,NULL,scale);
2192  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2193  funcpointer = D3DXVec3Scale(NULL,NULL,scale);
2194  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2195 
2196 /*_______________D3DXVec3Subtract_______________________*/
2197  expectedvec.x = 7.0f; expectedvec.y = 9.0f; expectedvec.z = 6.0f;
2198  D3DXVec3Subtract(&gotvec,&u,&v);
2199  expect_vec3(&expectedvec, &gotvec, 0);
2200  /* Tests the case NULL */
2201  funcpointer = D3DXVec3Subtract(&gotvec,NULL,&v);
2202  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2203  funcpointer = D3DXVec3Subtract(NULL,NULL,NULL);
2204  ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
2205 
2206 /*_______________D3DXVec3Transform_______________________*/
2207  expectedtrans.x = 70.0f; expectedtrans.y = 88.0f; expectedtrans.z = 106.0f; expectedtrans.w = 124.0f;
2208  D3DXVec3Transform(&gottrans, &u, &mat);
2209  expect_vec4(&expectedtrans, &gottrans, 0);
2210 
2211  gottrans.x = u.x; gottrans.y = u.y; gottrans.z = u.z;
2212  D3DXVec3Transform(&gottrans, (D3DXVECTOR3 *)&gottrans, &mat);
2213  expect_vec4(&expectedtrans, &gottrans, 0);
2214 
2215 /*_______________D3DXVec3TransformCoord_______________________*/
2216  expectedvec.x = 70.0f/124.0f; expectedvec.y = 88.0f/124.0f; expectedvec.z = 106.0f/124.0f;
2217  D3DXVec3TransformCoord(&gotvec,&u,&mat);
2218  expect_vec3(&expectedvec, &gotvec, 1);
2219 
2220 /*_______________D3DXVec3TransformNormal______________________*/
2221  expectedvec.x = 57.0f; expectedvec.y = 74.0f; expectedvec.z = 91.0f;
2222  D3DXVec3TransformNormal(&gotvec,&u,&mat);
2223  expect_vec3(&expectedvec, &gotvec, 0);
2224 
2225 /*_______________D3DXVec3Project_________________________*/
2226  expectedvec.x = 1135.721924f; expectedvec.y = 147.086914f; expectedvec.z = 0.153412f;
2227  D3DXMatrixPerspectiveFovLH(&projection,D3DX_PI/4.0f,20.0f/17.0f,1.0f,1000.0f);
2228  D3DXVec3Project(&gotvec,&u,&viewport,&projection,&view,&world);
2229  expect_vec3(&expectedvec, &gotvec, 32);
2230  /* World matrix can be omitted */
2231  D3DXMatrixMultiply(&mat,&world,&view);
2232  D3DXVec3Project(&gotvec,&u,&viewport,&projection,&mat,NULL);
2233  expect_vec3(&expectedvec, &gotvec, 32);
2234  /* Projection matrix can be omitted */
2235  D3DXMatrixMultiply(&mat,&view,&projection);
2236  D3DXVec3Project(&gotvec,&u,&viewport,NULL,&mat,&world);
2237  expect_vec3(&expectedvec, &gotvec, 32);
2238  /* View matrix can be omitted */
2239  D3DXMatrixMultiply(&mat,&world,&view);
2240  D3DXVec3Project(&gotvec,&u,&viewport,&projection,NULL,&mat);
2241  expect_vec3(&expectedvec, &gotvec, 32);
2242  /* All matrices can be omitted */
2243  expectedvec.x = 4010.000000f; expectedvec.y = -1695.000000f; expectedvec.z = 1.600000f;
2244  D3DXVec3Project(&gotvec,&u,&viewport,NULL,NULL,NULL);
2245  expect_vec3(&expectedvec, &gotvec, 2);
2246  /* Viewport can be omitted */
2247  expectedvec.x = 1.814305f; expectedvec.y = 0.582097f; expectedvec.z = -0.066555f;
2248  D3DXVec3Project(&gotvec,&u,NULL,&projection,&view,&world);
2249  expect_vec3(&expectedvec, &gotvec, 64);
2250 
2251 /*_______________D3DXVec3Unproject_________________________*/
2252  expectedvec.x = -2.913411f; expectedvec.y = 1.593215f; expectedvec.z = 0.380724f;
2253  D3DXMatrixPerspectiveFovLH(&projection,D3DX_PI/4.0f,20.0f/17.0f,1.0f,1000.0f);
2254  D3DXVec3Unproject(&gotvec,&u,&viewport,&projection,&view,&world);
2255  expect_vec3(&expectedvec, &gotvec, 16);
2256  /* World matrix can be omitted */
2257  D3DXMatrixMultiply(&mat,&world,&view);
2258  D3DXVec3Unproject(&gotvec,&u,&viewport,&projection,&mat,NULL);
2259  expect_vec3(&expectedvec, &gotvec, 16);
2260  /* Projection matrix can be omitted */
2261  D3DXMatrixMultiply(&mat,&view,&projection);
2262  D3DXVec3Unproject(&gotvec,&u,&viewport,NULL,&mat,&world);
2263  expect_vec3(&expectedvec, &gotvec, 32);
2264  /* View matrix can be omitted */
2265  D3DXMatrixMultiply(&mat,&world,&view);
2266  D3DXVec3Unproject(&gotvec,&u,&viewport,&projection,NULL,&mat);
2267  expect_vec3(&expectedvec, &gotvec, 16);
2268  /* All matrices can be omitted */
2269  expectedvec.x = -1.002500f; expectedvec.y = 0.997059f; expectedvec.z = 2.571429f;
2270  D3DXVec3Unproject(&gotvec,&u,&viewport,NULL,NULL,NULL);
2271  expect_vec3(&expectedvec, &gotvec, 4);
2272  /* Viewport can be omitted */
2273  expectedvec.x = -11.018396f; expectedvec.y = 3.218991f; expectedvec.z = 1.380329f;
2274  D3DXVec3Unproject(&gotvec,&u,NULL,&projection,&view,&world);
2275  expect_vec3(&expectedvec, &gotvec, 8);
2276 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
D3DXVECTOR3 *WINAPI D3DXVec3CatmullRom(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv0, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pv3, FLOAT s)
Definition: math.c:1774
D3DXVECTOR3 *WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pt1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pt2, FLOAT s)
Definition: math.c:1784
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
static void set_matrix(D3DXMATRIX *mat, float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
Definition: math.c:196
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1924
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
Definition: math.c:393
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define U(x)
Definition: wordpad.c:45
#define equal(x, y)
Definition: reader.cc:56
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static const MAT2 mat
Definition: font.c:66
static BOOL compare_float(float f, float g, unsigned int ulps)
Definition: math.c:26
D3DXVECTOR3 *WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DVIEWPORT9 *pviewport, const D3DXMATRIX *pprojection, const D3DXMATRIX *pview, const D3DXMATRIX *pworld)
Definition: math.c:1824
#define expect_vec4(expected, vector, ulps)
Definition: math.c:120
D3DXVECTOR3 *WINAPI D3DXVec3Unproject(D3DXVECTOR3 *out, const D3DXVECTOR3 *v, const D3DVIEWPORT9 *viewport, const D3DXMATRIX *projection, const D3DXMATRIX *view, const D3DXMATRIX *world)
Definition: math.c:1952
D3DXVECTOR3 *WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pv3, FLOAT f, FLOAT g)
Definition: math.c:1764
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define expect_vec3(expected, vector, ulps)
Definition: math.c:111
GLfloat f
Definition: glext.h:7540
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1891
D3DXVECTOR4 *WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1862
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
#define D3DX_PI
Definition: d3dx9math.h:27
static IOleDocumentView * view
Definition: activex.c:1749
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf)
Definition: math.c:479
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1801

Referenced by START_TEST().

◆ D3DXVector4Test()

static void D3DXVector4Test ( void  )
static

Definition at line 2278 of file math.c.

2279 {
2280  D3DXVECTOR4 expectedvec, gotvec, u, v, w, x;
2281  LPD3DXVECTOR4 funcpointer;
2282  D3DXVECTOR4 expectedtrans, gottrans;
2283  float coeff1, coeff2, got, scale;
2284  D3DXMATRIX mat;
2285  BOOL equal;
2286 
2287  u.x = 1.0f; u.y = 2.0f; u.z = 4.0f; u.w = 10.0;
2288  v.x = -3.0f; v.y = 4.0f; v.z = -5.0f; v.w = 7.0;
2289  w.x = 4.0f; w.y =6.0f; w.z = -2.0f; w.w = 1.0f;
2290  x.x = 6.0f; x.y = -7.0f; x.z =8.0f; x.w = -9.0f;
2291 
2292  set_matrix(&mat,
2293  1.0f, 2.0f, 3.0f, 4.0f,
2294  5.0f, 6.0f, 7.0f, 8.0f,
2295  9.0f, 10.0f, 11.0f, 12.0f,
2296  13.0f, 14.0f, 15.0f, 16.0f);
2297 
2298  coeff1 = 2.0f; coeff2 = 5.0;
2299  scale = -6.5f;
2300 
2301 /*_______________D3DXVec4Add__________________________*/
2302  expectedvec.x = -2.0f; expectedvec.y = 6.0f; expectedvec.z = -1.0f; expectedvec.w = 17.0f;
2303  D3DXVec4Add(&gotvec,&u,&v);
2304  expect_vec4(&expectedvec, &gotvec, 0);
2305  /* Tests the case NULL */
2306  funcpointer = D3DXVec4Add(&gotvec,NULL,&v);
2307  ok(funcpointer == NULL, "Expected: %p, Got: %p\n"