From 7970cc3aefcd555de9bb921470b745f0b38655f8 Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Thu, 17 Sep 2015 12:59:46 +0300 Subject: [PATCH] Fix geometry tests structure --- geometry/geometry_tests/region_test.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/geometry/geometry_tests/region_test.cpp b/geometry/geometry_tests/region_test.cpp index 714ad56806..5af4758335 100644 --- a/geometry/geometry_tests/region_test.cpp +++ b/geometry/geometry_tests/region_test.cpp @@ -136,10 +136,8 @@ UNIT_TEST(Region) } -UNIT_TEST(Region_Contains) +UNIT_TEST(Region_Contains_int32) { - TestContaints(); - TestContaints(); TestContaints(); // negative triangle @@ -171,6 +169,27 @@ UNIT_TEST(Region_Contains) } } +UNIT_TEST(Region_Contains_uint32) +{ + TestContaints(); +} + +UNIT_TEST(Region_Contains_double) +{ + TestContaints(); + + { + typedef m2::PointD P; + m2::Region

region; + P const data[] = { P(0, 7), P(4, 4), P(3, 6), P(8, 6), P(8, 5), P(6, 3), P(2, 2) }; + region.Assign(data, data + ARRAY_SIZE(data)); + + TEST_EQUAL(region.GetRect(), m2::Rect(0, 2, 8, 7), ()); + + TEST(!region.Contains(P(3, 5)), ()); + } +} + template class PointsSummator { TPoint & m_res;