diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/test/llquaternion_tut.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/linden/indra/test/llquaternion_tut.cpp b/linden/indra/test/llquaternion_tut.cpp index f64e87a..bfca1c4 100644 --- a/linden/indra/test/llquaternion_tut.cpp +++ b/linden/indra/test/llquaternion_tut.cpp | |||
@@ -4,7 +4,9 @@ | |||
4 | * @date 2007-03 | 4 | * @date 2007-03 |
5 | * @brief Test cases of llquaternion.h | 5 | * @brief Test cases of llquaternion.h |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2007, Linden Research, Inc. | 7 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
8 | * | ||
9 | * Copyright (c) 2007, Linden Research, Inc. | ||
8 | * | 10 | * |
9 | * Second Life Viewer Source Code | 11 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 12 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -26,12 +28,13 @@ | |||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 28 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
28 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
31 | * $/LicenseInfo$ | ||
29 | */ | 32 | */ |
30 | 33 | ||
31 | #include <tut/tut.h> | 34 | #include <tut/tut.h> |
32 | #include "llmath.h" | 35 | |
33 | #include "lltut.h" | ||
34 | #include "linden_common.h" | 36 | #include "linden_common.h" |
37 | #include "lltut.h" | ||
35 | #include "llquaternion.h" | 38 | #include "llquaternion.h" |
36 | #include "v4math.h" | 39 | #include "v4math.h" |
37 | #include "v3math.h" | 40 | #include "v3math.h" |
@@ -335,16 +338,15 @@ namespace tut | |||
335 | template<> template<> | 338 | template<> template<> |
336 | void llquat_test_object_t::test<10>() | 339 | void llquat_test_object_t::test<10>() |
337 | { | 340 | { |
338 | #if (LL_RELEASE && LL_LINUX) | ||
339 | skip_fail("Doesn't work under Linux -- FIX ME!"); | ||
340 | #endif | ||
341 | LLVector4 vect(12.0f, 5.0f, 60.0f, 75.1f); | 341 | LLVector4 vect(12.0f, 5.0f, 60.0f, 75.1f); |
342 | LLQuaternion quat(2323.034f, 23.5f, 673.23f, 57667.5f); | 342 | LLQuaternion quat(2323.034f, 23.5f, 673.23f, 57667.5f); |
343 | LLVector4 result = vect * quat; | 343 | LLVector4 result = vect * quat; |
344 | ensure( | 344 | ensure( |
345 | "1. LLVector4 operator*(const LLVector4 &a, const LLQuaternion &rot) failed", | 345 | "1. LLVector4 operator*(const LLVector4 &a, const LLQuaternion &rot) failed", |
346 | (39928406016.0f == result.mV[0]) && | 346 | (39928406016.0f == result.mV[0]) && |
347 | (1457801728.0f == result.mV[1]) && | 347 | // gcc on x86 actually gives us more precision than we were expecting, verified with -ffloat-store - we forgive this |
348 | (1457802240.0f >= result.mV[1]) && // gcc+x86+linux | ||
349 | (1457801728.0f <= result.mV[1]) && // elsewhere | ||
348 | (200580612096.0f == result.mV[2]) && | 350 | (200580612096.0f == result.mV[2]) && |
349 | (75.099998f == result.mV[3])); | 351 | (75.099998f == result.mV[3])); |
350 | 352 | ||
@@ -367,7 +369,7 @@ namespace tut | |||
367 | LLQuaternion quat(23.5f, 6.5f, 3.23f, 56.5f); | 369 | LLQuaternion quat(23.5f, 6.5f, 3.23f, 56.5f); |
368 | LLVector3 result = vect * quat; | 370 | LLVector3 result = vect * quat; |
369 | ensure( | 371 | ensure( |
370 | "1. LLVEctor3 operator*(const LLVector3 &a, const LLQuaternion &rot) failed", | 372 | "1. LLVector3 operator*(const LLVector3 &a, const LLQuaternion &rot) failed", |
371 | is_approx_equal(97182.953125f,result.mV[0]) && | 373 | is_approx_equal(97182.953125f,result.mV[0]) && |
372 | is_approx_equal(-135405.640625f, result.mV[1]) && | 374 | is_approx_equal(-135405.640625f, result.mV[1]) && |
373 | is_approx_equal(162986.140f, result.mV[2])); | 375 | is_approx_equal(162986.140f, result.mV[2])); |
@@ -390,7 +392,7 @@ namespace tut | |||
390 | LLQuaternion quat(-3.5f, 4.5f, 3.5f, 6.5f); | 392 | LLQuaternion quat(-3.5f, 4.5f, 3.5f, 6.5f); |
391 | LLVector3d result = vect * quat; | 393 | LLVector3d result = vect * quat; |
392 | ensure( | 394 | ensure( |
393 | "1. LLVEctor3d operator*(const LLVector3d &a, const LLQuaternion &rot) failed ", | 395 | "1. LLVector3d operator*(const LLVector3d &a, const LLQuaternion &rot) failed ", |
394 | (-633.0f == result.mdV[0]) && | 396 | (-633.0f == result.mdV[0]) && |
395 | (-300.0f == result.mdV[1]) && | 397 | (-300.0f == result.mdV[1]) && |
396 | (-36.0f == result.mdV[2])); | 398 | (-36.0f == result.mdV[2])); |
@@ -408,7 +410,7 @@ namespace tut | |||
408 | LLQuaternion quat2(1.0f, 4.0f, 2.0f, 5.0f); | 410 | LLQuaternion quat2(1.0f, 4.0f, 2.0f, 5.0f); |
409 | result = vect2 * quat2; | 411 | result = vect2 * quat2; |
410 | ensure( | 412 | ensure( |
411 | "3. LLvector3d operator*(const LLVector3d &a, const LLQuaternion &rot) failed", | 413 | "3. LLVector3d operator*(const LLVector3d &a, const LLQuaternion &rot) failed", |
412 | is_approx_equal_fraction(18.400001f, (F32) result.mdV[0], 8) && | 414 | is_approx_equal_fraction(18.400001f, (F32) result.mdV[0], 8) && |
413 | is_approx_equal_fraction(188.6f, (F32) result.mdV[1], 8) && | 415 | is_approx_equal_fraction(188.6f, (F32) result.mdV[1], 8) && |
414 | is_approx_equal_fraction(32.20f, (F32) result.mdV[2], 8)); | 416 | is_approx_equal_fraction(32.20f, (F32) result.mdV[2], 8)); |