diff options
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/tests/mathmisc_test.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp index ff0899e975..2b23987616 100644 --- a/indra/llmath/tests/mathmisc_test.cpp +++ b/indra/llmath/tests/mathmisc_test.cpp @@ -709,14 +709,34 @@ namespace tut first_plane, second_plane); - ensure("plane intersection should succeed", success); + try + { + ensure("plane intersection should succeed", success); - F32 dot = fabs(known_intersection.getDirection() * measured_intersection.getDirection()); - ensure("measured intersection should be parallel to known intersection", - dot > ALMOST_PARALLEL); + F32 dot = fabs(known_intersection.getDirection() * measured_intersection.getDirection()); + ensure("measured intersection should be parallel to known intersection", + dot > ALMOST_PARALLEL); - ensure("measured intersection should pass near known point", - measured_intersection.intersects(some_point, LARGE_RADIUS * allowable_relative_error)); + ensure("measured intersection should pass near known point", + measured_intersection.intersects(some_point, LARGE_RADIUS * allowable_relative_error)); + } + catch (const failure&) + { + // If any of these assertions fail, since the values involved + // are randomly generated, unless we report them, we have no + // hope of diagnosing the problem. + LL_INFOS() << "some_point = " << some_point << '\n' + << "another_point = " << another_point << '\n' + << "known_intersection = " << known_intersection << '\n' + << "point_on_plane = " << point_on_plane << '\n' + << "plane_normal = " << plane_normal << '\n' + << "first_plane = " << first_plane << '\n' + << "point_on_different_plane = " << point_on_different_plane << '\n' + << "different_plane_normal = " << different_plane_normal << '\n' + << "second_plane = " << second_plane << '\n' + << "measured_intersection = " << measured_intersection << LL_ENDL; + throw; + } } } } |