2 * Copyright 2007 David Adam
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "d3dx8math.h"
21 #include "d3dx8math.inl"
23 #include "wine/test.h"
25 #define admitted_error 0.00001f
27 #define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error),"Expected Vector= (%f, %f)\n , Got Vector= (%f, %f)\n", expectedvec.x, expectedvec.y, gotvec.x, gotvec.y);
29 #define expect_vec3(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error),"Expected Vector= (%f, %f,%f)\n , Got Vector= (%f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, gotvec.x, gotvec.y, gotvec.z);
31 #define expect_vec4(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error)&&(fabs(expectedvec.w-gotvec.w)<admitted_error),"Expected Vector= (%f, %f, %f, %f)\n , Got Vector= (%f, %f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, expectedvec.w, gotvec.x, gotvec.y, gotvec.z, gotvec.w);
33 static void D3X8QuaternionTest(void)
35 D3DXQUATERNION expectedquat
, gotquat
, q
, r
;
36 LPD3DXQUATERNION funcpointer
;
39 q
.x
= 1.0f
, q
.y
= 2.0f
; q
.z
= 4.0f
; q
.w
= 10.0f
;
40 r
.x
= -3.0f
; r
.y
= 4.0f
; r
.z
= -5.0f
; r
.w
= 7.0;
42 /*_______________D3DXQuaternionConjugate________________*/
43 expectedquat
.x
= -1.0f
; expectedquat
.y
= -2.0f
; expectedquat
.z
= -4.0f
; expectedquat
.w
= 10.0f
;
44 D3DXQuaternionConjugate(&gotquat
,&q
);
45 expect_vec4(expectedquat
,gotquat
);
46 /* Test the NULL case */
47 funcpointer
= D3DXQuaternionConjugate(&gotquat
,NULL
);
48 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
49 funcpointer
= D3DXQuaternionConjugate(NULL
,NULL
);
50 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
53 /*_______________D3DXQuaternionDot______________________*/
55 got
= D3DXQuaternionDot(&q
,&r
);
56 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
57 /* Tests the case NULL */
59 got
= D3DXQuaternionDot(NULL
,&r
);
60 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
62 got
= D3DXQuaternionDot(NULL
,NULL
);
63 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
65 /*_______________D3DXQuaternionLength__________________________*/
67 got
= D3DXQuaternionLength(&q
);
68 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
69 /* Tests the case NULL */
71 got
= D3DXQuaternionLength(NULL
);
72 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
74 /*_______________D3DXQuaternionLengthSq________________________*/
76 got
= D3DXQuaternionLengthSq(&q
);
77 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
78 /* Tests the case NULL */
80 got
= D3DXQuaternionLengthSq(NULL
);
81 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
84 static void D3X8Vector2Test(void)
86 D3DXVECTOR2 expectedvec
, gotvec
, u
, v
;
87 LPD3DXVECTOR2 funcpointer
;
88 FLOAT expected
, got
, scale
;
94 /*_______________D3DXVec2Add__________________________*/
95 expectedvec
.x
= -4.0f
; expectedvec
.y
= 13.0f
;
96 D3DXVec2Add(&gotvec
,&u
,&v
);
97 expect_vec(expectedvec
,gotvec
);
98 /* Tests the case NULL */
99 funcpointer
= D3DXVec2Add(&gotvec
,NULL
,&v
);
100 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
101 funcpointer
= D3DXVec2Add(NULL
,NULL
,NULL
);
102 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
104 /*_______________D3DXVec2CCW__________________________*/
106 got
= D3DXVec2CCW(&u
,&v
);
107 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
108 /* Tests the case NULL */
110 got
= D3DXVec2CCW(NULL
,&v
);
111 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
113 got
= D3DXVec2CCW(NULL
,NULL
);
114 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
116 /*_______________D3DXVec2Dot__________________________*/
118 got
= D3DXVec2Dot(&u
,&v
);
119 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
120 /* Tests the case NULL */
122 got
= D3DXVec2Dot(NULL
,&v
);
123 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
125 got
= D3DXVec2Dot(NULL
,NULL
);
126 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
128 /*_______________D3DXVec2Length__________________________*/
130 got
= D3DXVec2Length(&u
);
131 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
132 /* Tests the case NULL */
134 got
= D3DXVec2Length(NULL
);
135 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
137 /*_______________D3DXVec2LengthSq________________________*/
139 got
= D3DXVec2LengthSq(&u
);
140 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
141 /* Tests the case NULL */
143 got
= D3DXVec2LengthSq(NULL
);
144 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
146 /*_______________D3DXVec2Lerp__________________________*/
147 expectedvec
.x
= 68.0f
; expectedvec
.y
= -28.5f
;
148 D3DXVec2Lerp(&gotvec
,&u
,&v
,scale
);
149 expect_vec(expectedvec
,gotvec
);
150 /* Tests the case NULL */
151 funcpointer
= D3DXVec2Lerp(&gotvec
,NULL
,&v
,scale
);
152 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
153 funcpointer
= D3DXVec2Lerp(NULL
,NULL
,NULL
,scale
);
154 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
156 /*_______________D3DXVec2Maximize__________________________*/
157 expectedvec
.x
= 3.0f
; expectedvec
.y
= 9.0f
;
158 D3DXVec2Maximize(&gotvec
,&u
,&v
);
159 expect_vec(expectedvec
,gotvec
);
160 /* Tests the case NULL */
161 funcpointer
= D3DXVec2Maximize(&gotvec
,NULL
,&v
);
162 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
163 funcpointer
= D3DXVec2Maximize(NULL
,NULL
,NULL
);
164 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
166 /*_______________D3DXVec2Minimize__________________________*/
167 expectedvec
.x
= -7.0f
; expectedvec
.y
= 4.0f
;
168 D3DXVec2Minimize(&gotvec
,&u
,&v
);
169 expect_vec(expectedvec
,gotvec
);
170 /* Tests the case NULL */
171 funcpointer
= D3DXVec2Minimize(&gotvec
,NULL
,&v
);
172 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
173 funcpointer
= D3DXVec2Minimize(NULL
,NULL
,NULL
);
174 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
176 /*_______________D3DXVec2Scale____________________________*/
177 expectedvec
.x
= -19.5f
; expectedvec
.y
= -26.0f
;
178 D3DXVec2Scale(&gotvec
,&u
,scale
);
179 expect_vec(expectedvec
,gotvec
);
180 /* Tests the case NULL */
181 funcpointer
= D3DXVec2Scale(&gotvec
,NULL
,scale
);
182 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
183 funcpointer
= D3DXVec2Scale(NULL
,NULL
,scale
);
184 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
186 /*_______________D3DXVec2Subtract__________________________*/
187 expectedvec
.x
= 10.0f
; expectedvec
.y
= -5.0f
;
188 D3DXVec2Subtract(&gotvec
,&u
,&v
);
189 expect_vec(expectedvec
,gotvec
);
190 /* Tests the case NULL */
191 funcpointer
= D3DXVec2Subtract(&gotvec
,NULL
,&v
);
192 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
193 funcpointer
= D3DXVec2Subtract(NULL
,NULL
,NULL
);
194 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
198 static void D3X8Vector3Test(void)
200 D3DXVECTOR3 expectedvec
, gotvec
, u
, v
;
201 LPD3DXVECTOR3 funcpointer
;
202 FLOAT expected
, got
, scale
;
204 u
.x
= 9.0f
; u
.y
= 6.0f
; u
.z
= 2.0f
;
205 v
.x
= 2.0f
; v
.y
= -3.0f
; v
.z
= -4.0;
208 /*_______________D3DXVec3Add__________________________*/
209 expectedvec
.x
= 11.0f
; expectedvec
.y
= 3.0f
; expectedvec
.z
= -2.0f
;
210 D3DXVec3Add(&gotvec
,&u
,&v
);
211 expect_vec3(expectedvec
,gotvec
);
212 /* Tests the case NULL */
213 funcpointer
= D3DXVec3Add(&gotvec
,NULL
,&v
);
214 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
215 funcpointer
= D3DXVec3Add(NULL
,NULL
,NULL
);
216 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
218 /*_______________D3DXVec3Cross________________________*/
219 expectedvec
.x
= -18.0f
; expectedvec
.y
= 40.0f
; expectedvec
.z
= -30.0f
;
220 D3DXVec3Cross(&gotvec
,&u
,&v
);
221 /* Tests the case NULL */
222 funcpointer
= D3DXVec3Cross(&gotvec
,NULL
,&v
);
223 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
224 funcpointer
= D3DXVec3Cross(NULL
,NULL
,NULL
);
225 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
227 /*_______________D3DXVec3Dot__________________________*/
229 got
= D3DXVec3Dot(&u
,&v
);
230 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
231 /* Tests the case NULL */
233 got
= D3DXVec3Dot(NULL
,&v
);
234 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
236 got
= D3DXVec3Dot(NULL
,NULL
);
237 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
239 /*_______________D3DXVec3Length__________________________*/
241 got
= D3DXVec3Length(&u
);
242 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
243 /* Tests the case NULL */
245 got
= D3DXVec3Length(NULL
);
246 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
248 /*_______________D3DXVec3LengthSq________________________*/
250 got
= D3DXVec3LengthSq(&u
);
251 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
252 /* Tests the case NULL */
254 got
= D3DXVec3LengthSq(NULL
);
255 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
257 /*_______________D3DXVec3Lerp__________________________*/
258 expectedvec
.x
= 54.5f
; expectedvec
.y
= 64.5f
, expectedvec
.z
= 41.0f
;
259 D3DXVec3Lerp(&gotvec
,&u
,&v
,scale
);
260 expect_vec3(expectedvec
,gotvec
);
261 /* Tests the case NULL */
262 funcpointer
= D3DXVec3Lerp(&gotvec
,NULL
,&v
,scale
);
263 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
264 funcpointer
= D3DXVec3Lerp(NULL
,NULL
,NULL
,scale
);
265 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
267 /*_______________D3DXVec3Maximize__________________________*/
268 expectedvec
.x
= 9.0f
; expectedvec
.y
= 6.0f
; expectedvec
.z
= 2.0f
;
269 D3DXVec3Maximize(&gotvec
,&u
,&v
);
270 expect_vec3(expectedvec
,gotvec
);
271 /* Tests the case NULL */
272 funcpointer
= D3DXVec3Maximize(&gotvec
,NULL
,&v
);
273 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
274 funcpointer
= D3DXVec3Maximize(NULL
,NULL
,NULL
);
275 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
277 /*_______________D3DXVec3Minimize__________________________*/
278 expectedvec
.x
= 2.0f
; expectedvec
.y
= -3.0f
; expectedvec
.z
= -4.0f
;
279 D3DXVec3Minimize(&gotvec
,&u
,&v
);
280 expect_vec3(expectedvec
,gotvec
);
281 /* Tests the case NULL */
282 funcpointer
= D3DXVec3Minimize(&gotvec
,NULL
,&v
);
283 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
284 funcpointer
= D3DXVec3Minimize(NULL
,NULL
,NULL
);
285 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
287 /*_______________D3DXVec3Scale____________________________*/
288 expectedvec
.x
= -58.5f
; expectedvec
.y
= -39.0f
; expectedvec
.z
= -13.0f
;
289 D3DXVec3Scale(&gotvec
,&u
,scale
);
290 expect_vec3(expectedvec
,gotvec
);
291 /* Tests the case NULL */
292 funcpointer
= D3DXVec3Scale(&gotvec
,NULL
,scale
);
293 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
294 funcpointer
= D3DXVec3Scale(NULL
,NULL
,scale
);
295 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
297 /*_______________D3DXVec3Subtract_______________________*/
298 expectedvec
.x
= 7.0f
; expectedvec
.y
= 9.0f
; expectedvec
.z
= 6.0f
;
299 D3DXVec3Subtract(&gotvec
,&u
,&v
);
300 expect_vec3(expectedvec
,gotvec
);
301 /* Tests the case NULL */
302 funcpointer
= D3DXVec3Subtract(&gotvec
,NULL
,&v
);
303 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
304 funcpointer
= D3DXVec3Subtract(NULL
,NULL
,NULL
);
305 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
309 static void D3X8Vector4Test(void)
311 D3DXVECTOR4 expectedvec
, gotvec
, u
, v
;
312 LPD3DXVECTOR4 funcpointer
;
313 FLOAT expected
, got
, scale
;
316 u
.x
= 1.0f
; u
.y
= 2.0f
; u
.z
= 4.0f
; u
.w
= 10.0;
317 v
.x
= -3.0f
; v
.y
= 4.0f
; v
.z
= -5.0f
; v
.w
= 7.0;
319 /*_______________D3DXVec4Add__________________________*/
320 expectedvec
.x
= -2.0f
; expectedvec
.y
= 6.0f
; expectedvec
.z
= -1.0f
; expectedvec
.w
= 17.0f
;
321 D3DXVec4Add(&gotvec
,&u
,&v
);
322 expect_vec4(expectedvec
,gotvec
);
323 /* Tests the case NULL */
324 funcpointer
= D3DXVec4Add(&gotvec
,NULL
,&v
);
325 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
326 funcpointer
= D3DXVec4Add(NULL
,NULL
,NULL
);
327 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
329 /*_______________D3DXVec4Dot__________________________*/
331 got
= D3DXVec4Dot(&u
,&v
);
332 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
333 /* Tests the case NULL */
335 got
= D3DXVec4Dot(NULL
,&v
);
336 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
338 got
= D3DXVec4Dot(NULL
,NULL
);
339 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
341 /*_______________D3DXVec4Length__________________________*/
343 got
= D3DXVec4Length(&u
);
344 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
345 /* Tests the case NULL */
347 got
= D3DXVec4Length(NULL
);
348 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
350 /*_______________D3DXVec4LengthSq________________________*/
352 got
= D3DXVec4LengthSq(&u
);
353 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
354 /* Tests the case NULL */
356 got
= D3DXVec4LengthSq(NULL
);
357 ok(fabs( got
- expected
) < admitted_error
, "Expected: %f, Got: %f\n", expected
, got
);
359 /*_______________D3DXVec4Lerp__________________________*/
360 expectedvec
.x
= 27.0f
; expectedvec
.y
= -11.0f
; expectedvec
.z
= 62.5; expectedvec
.w
= 29.5;
361 D3DXVec4Lerp(&gotvec
,&u
,&v
,scale
);
362 expect_vec4(expectedvec
,gotvec
);
363 /* Tests the case NULL */
364 funcpointer
= D3DXVec4Lerp(&gotvec
,NULL
,&v
,scale
);
365 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
366 funcpointer
= D3DXVec4Lerp(NULL
,NULL
,NULL
,scale
);
367 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
369 /*_______________D3DXVec4Maximize__________________________*/
370 expectedvec
.x
= 1.0f
; expectedvec
.y
= 4.0f
; expectedvec
.z
= 4.0f
; expectedvec
.w
= 10.0;
371 D3DXVec4Maximize(&gotvec
,&u
,&v
);
372 expect_vec4(expectedvec
,gotvec
);
373 /* Tests the case NULL */
374 funcpointer
= D3DXVec4Maximize(&gotvec
,NULL
,&v
);
375 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
376 funcpointer
= D3DXVec4Maximize(NULL
,NULL
,NULL
);
377 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
379 /*_______________D3DXVec4Minimize__________________________*/
380 expectedvec
.x
= -3.0f
; expectedvec
.y
= 2.0f
; expectedvec
.z
= -5.0f
; expectedvec
.w
= 7.0;
381 D3DXVec4Minimize(&gotvec
,&u
,&v
);
382 expect_vec4(expectedvec
,gotvec
);
383 /* Tests the case NULL */
384 funcpointer
= D3DXVec4Minimize(&gotvec
,NULL
,&v
);
385 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
386 funcpointer
= D3DXVec4Minimize(NULL
,NULL
,NULL
);
387 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
389 /*_______________D3DXVec4Scale____________________________*/
390 expectedvec
.x
= -6.5f
; expectedvec
.y
= -13.0f
; expectedvec
.z
= -26.0f
; expectedvec
.w
= -65.0f
;
391 D3DXVec4Scale(&gotvec
,&u
,scale
);
392 expect_vec4(expectedvec
,gotvec
);
393 /* Tests the case NULL */
394 funcpointer
= D3DXVec4Scale(&gotvec
,NULL
,scale
);
395 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
396 funcpointer
= D3DXVec4Scale(NULL
,NULL
,scale
);
397 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
399 /*_______________D3DXVec4Subtract__________________________*/
400 expectedvec
.x
= 4.0f
; expectedvec
.y
= -2.0f
; expectedvec
.z
= 9.0f
; expectedvec
.w
= 3.0f
;
401 D3DXVec4Subtract(&gotvec
,&u
,&v
);
402 expect_vec4(expectedvec
,gotvec
);
403 /* Tests the case NULL */
404 funcpointer
= D3DXVec4Subtract(&gotvec
,NULL
,&v
);
405 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
406 funcpointer
= D3DXVec4Subtract(NULL
,NULL
,NULL
);
407 ok(funcpointer
== NULL
, "Expected: %p, Got: %p\n", NULL
, funcpointer
);
412 D3X8QuaternionTest();