diff --git a/qa/common/geometry/test_shape_poly_set_distance.cpp b/qa/common/geometry/test_shape_poly_set_distance.cpp index 79de9620a1..5917a9a59f 100644 --- a/qa/common/geometry/test_shape_poly_set_distance.cpp +++ b/qa/common/geometry/test_shape_poly_set_distance.cpp @@ -31,6 +31,8 @@ #include #include +#include + /** * Declares the Boost test suite fixture. */ @@ -141,7 +143,7 @@ BOOST_AUTO_TEST_CASE( SegDistance ) int dist = polyset.Distance( c.m_seg, c.m_seg_width ); // right answer? - BOOST_CHECK_EQUAL( dist, c.m_exp_dist ); + BOOST_CHECK_PREDICATE( KI_TEST::IsWithin, ( dist )( c.m_exp_dist )( 1 ) ); } } } diff --git a/qa/unit_test_utils/include/unit_test_utils/geometry.h b/qa/unit_test_utils/include/unit_test_utils/geometry.h index 2f8be6f707..3d189cc6d0 100644 --- a/qa/unit_test_utils/include/unit_test_utils/geometry.h +++ b/qa/unit_test_utils/include/unit_test_utils/geometry.h @@ -14,7 +14,7 @@ * * TODO: convert to boost_test_print_type when Boost minver > 1.64 */ -std::ostream& operator<<( std::ostream& os, const BOX2I& aBox ) +inline std::ostream& operator<<( std::ostream& os, const BOX2I& aBox ) { os << "BOX[ " << aBox.GetOrigin() << " + " << aBox.GetSize() << " ]"; return os;