summaryrefslogtreecommitdiff
path: root/indra/llmath/tests
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2015-03-16 09:49:57 -0700
committerMerov Linden <merov@lindenlab.com>2015-03-16 09:49:57 -0700
commit9ba10bf1f2ee16eb082f4cb29b0b9f7172e7ce8e (patch)
tree9548ff32e0a1dc5b3f8a70b2a386827f72bf5284 /indra/llmath/tests
parent184bf6a76fd3b52efa83c93f56164d2adce7ed3e (diff)
parentd4a2e9fd9a0e7001a6c824ddd6cf37039a632b9d (diff)
Merge lindenlab/viewer-tools-update
Diffstat (limited to 'indra/llmath/tests')
-rwxr-xr-xindra/llmath/tests/llquaternion_test.cpp4
-rwxr-xr-xindra/llmath/tests/mathmisc_test.cpp24
-rwxr-xr-xindra/llmath/tests/v4coloru_test.cpp8
3 files changed, 18 insertions, 18 deletions
diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp
index e69010b2d6..3490829743 100755
--- a/indra/llmath/tests/llquaternion_test.cpp
+++ b/indra/llmath/tests/llquaternion_test.cpp
@@ -175,10 +175,10 @@ namespace tut
void llquat_test_object_t::test<6>()
{
LLQuaternion quat1(3.0f, 2.0f, 6.0f, 0.0f), quat2(1.0f, 1.0f, 1.0f, 1.0f);
- ensure("1. The two values are different", llround(12.000000f, 2) == llround(dot(quat1, quat2), 2));
+ ensure("1. The two values are different", ll_round(12.000000f, 2) == ll_round(dot(quat1, quat2), 2));
LLQuaternion quat0(3.0f, 9.334f, 34.5f, 23.0f), quat(34.5f, 23.23f, 2.0f, 45.5f);
- ensure("2. The two values are different", llround(1435.828807f, 2) == llround(dot(quat0, quat), 2));
+ ensure("2. The two values are different", ll_round(1435.828807f, 2) == ll_round(dot(quat0, quat), 2));
}
//test case for LLQuaternion &LLQuaternion::constrain(F32 radians) fn.
diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp
index 91a2e6c009..f12140cf8f 100755
--- a/indra/llmath/tests/mathmisc_test.cpp
+++ b/indra/llmath/tests/mathmisc_test.cpp
@@ -128,33 +128,33 @@ namespace tut
void math_object::test<8>()
{
F32 val = 430903.2f;
- S32 val1 = llround(val);
- ensure("float llround value 1", (430903 == val1));
+ S32 val1 = ll_round(val);
+ ensure("float ll_round value 1", (430903 == val1));
val = -430903.9f;
- val1 = llround(val);
- ensure("float llround value 2", (-430904 == val1));
+ val1 = ll_round(val);
+ ensure("float ll_round value 2", (-430904 == val1));
}
template<> template<>
void math_object::test<9>()
{
F32 val = 430905.2654f, nearest = 100.f;
- val = llround(val, nearest);
- ensure("float llround value 1", (430900 == val));
+ val = ll_round(val, nearest);
+ ensure("float ll_round value 1", (430900 == val));
val = -430905.2654f, nearest = 10.f;
- val = llround(val, nearest);
- ensure("float llround value 1", (-430910 == val));
+ val = ll_round(val, nearest);
+ ensure("float ll_round value 1", (-430910 == val));
}
template<> template<>
void math_object::test<10>()
{
F64 val = 430905.2654, nearest = 100.0;
- val = llround(val, nearest);
- ensure("double llround value 1", (430900 == val));
+ val = ll_round(val, nearest);
+ ensure("double ll_round value 1", (430900 == val));
val = -430905.2654, nearest = 10.0;
- val = llround(val, nearest);
- ensure("double llround value 1", (-430910.00000 == val));
+ val = ll_round(val, nearest);
+ ensure("double ll_round value 1", (-430910.00000 == val));
}
template<> template<>
diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp
index 128f6f3564..12e607a820 100755
--- a/indra/llmath/tests/v4coloru_test.cpp
+++ b/indra/llmath/tests/v4coloru_test.cpp
@@ -300,8 +300,8 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a),llcolor4u1;
const F32 fVal = 3.f;
llcolor4u1 = llcolor4u.multAll(fVal);
- ensure("multAll:Fail to multiply ", (((U8)llround(r * fVal) == llcolor4u1.mV[VX]) && (U8)llround(g * fVal) == llcolor4u1.mV[VY]
- && ((U8)llround(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)llround(a * fVal) == llcolor4u1.mV[VW])));
+ ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY]
+ && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW])));
}
template<> template<>
@@ -329,8 +329,8 @@ namespace tut
llcolor4u.setVecScaleClamp(color3);
const S32 MAX_COLOR = 255;
F32 color_scale_factor = MAX_COLOR/r;
- S32 r2 = llround(r * color_scale_factor);
- S32 g2 = llround(g * color_scale_factor);
+ S32 r2 = ll_round(r * color_scale_factor);
+ S32 g2 = ll_round(g * color_scale_factor);
ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
}
}