diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-06-23 17:41:14 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:52:14 +0300 |
commit | 6a828d27ba655fdae7365ebb81b33cc713e9a4fc (patch) | |
tree | eeff5cf7256c295b410cffd82a44f3f4caf95acd /geometry/geometry_tests | |
parent | f653249cdd4b82b305c6c291b37b05176768e744 (diff) |
Corrections after colleagues comments. Next portion.
Diffstat (limited to 'geometry/geometry_tests')
-rw-r--r-- | geometry/geometry_tests/angle_test.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/geometry/geometry_tests/angle_test.cpp b/geometry/geometry_tests/angle_test.cpp index b40415c985..63ffb200eb 100644 --- a/geometry/geometry_tests/angle_test.cpp +++ b/geometry/geometry_tests/angle_test.cpp @@ -76,10 +76,17 @@ UNIT_TEST(ShortestDistance) UNIT_TEST(TwoVectorsAngle) { - TEST_ALMOST_EQUAL_ULPS(ang::TwoVectorsAngle(m2::Point<double>(0, 0) /* p */, - m2::Point<double>(0, 1) /* p1 */, - m2::Point<double>(1, 0)) /* p2 */, 3 * math::pi2, ()); - TEST_ALMOST_EQUAL_ULPS(ang::TwoVectorsAngle(m2::Point<double>(1, 1) /* p */, - m2::Point<double>(2, 2) /* p1 */, - m2::Point<double>(1, 2)) /* p2 */, math::pi4, ()); + double const eps = 1e-10; + TEST(my::AlmostEqualAbs(ang::TwoVectorsAngle(m2::Point<double>(0, 0) /* p */, + m2::Point<double>(0, 1) /* p1 */, + m2::Point<double>(1, 0)) /* p2 */, 3 * math::pi2, eps), ()); + TEST(my::AlmostEqualAbs(ang::TwoVectorsAngle(m2::Point<double>(1, 1) /* p */, + m2::Point<double>(2, 2) /* p1 */, + m2::Point<double>(1, 2)) /* p2 */, math::pi4, eps), ()); + TEST(my::AlmostEqualAbs(ang::TwoVectorsAngle(m2::Point<double>(0, 0) /* p */, + m2::Point<double>(1, 0) /* p1 */, + m2::Point<double>(0, -1)) /* p2 */, 3 * math::pi2, eps), ()); + TEST(my::AlmostEqualAbs(ang::TwoVectorsAngle(m2::Point<double>(0, 0) /* p */, + m2::Point<double>(1, 0) /* p1 */, + m2::Point<double>(-1, 0)) /* p2 */, math::pi, eps), ()); } |