diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-10-04 12:53:38 -0400 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-10-08 19:15:30 +0300 |
commit | 1fde269ac6e98ff23fd896cb2fbf8a570cbee398 (patch) | |
tree | 70d31dda6c7cb13d3d5a215835b31caafdeadcc6 /indra/llmath | |
parent | 62c43a13ee843a0bbae862035fd77b1f26816277 (diff) |
Use approximate equality for failing v3dmath test.
Modernize lltut.h. Allow both F32 and F64 for ensure_approximately_equals() etc.
Use std::string_view instead of const char* for message string to allow
passing std::string as well. Use stringize() instead of explicit
std::stringstream idiom.
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/tests/v3dmath_test.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/indra/llmath/tests/v3dmath_test.cpp b/indra/llmath/tests/v3dmath_test.cpp index db08419012..36ad1067a2 100644 --- a/indra/llmath/tests/v3dmath_test.cpp +++ b/indra/llmath/tests/v3dmath_test.cpp @@ -504,14 +504,11 @@ namespace tut template<> template<> void v3dmath_object::test<24>() { -#if LL_WINDOWS && _MSC_VER < 1400 - skip("This fails on VS2003!"); -#else F64 x = 10., y = 20., z = -15.; F64 angle1, angle2; LLVector3d vec3Da(x,y,z), vec3Db(x,y,z); angle1 = angle_between(vec3Da, vec3Db); - ensure("1:angle_between: Fail ", (0 == angle1)); + ensure_approximately_equals_range("1:angle_between: Fail ", angle1, 0., 1.5e-8); F64 x1 = -1., y1 = -20., z1 = -1.; vec3Da.clearVec(); vec3Da.setVec(x1,y1,z1); @@ -520,12 +517,6 @@ namespace tut vec3Da.normVec(); F64 angle = vec3Db*vec3Da; angle = acos(angle); -#if LL_WINDOWS && _MSC_VER > 1900 - skip("This fails on VS2017!"); -#else - ensure("2:angle_between: Fail ", (angle == angle2)); -#endif - -#endif + ensure_equals("2:angle_between: Fail ", angle, angle2); } } |