diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2015-09-17 12:59:46 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:06:10 +0300 |
commit | 7970cc3aefcd555de9bb921470b745f0b38655f8 (patch) | |
tree | bd3da0f93e53ae8c2bc22f073945966209488a54 /geometry/geometry_tests | |
parent | 2a3bf389181c4b9693aca338503fbe1379c2a2c7 (diff) |
Fix geometry tests structure
Diffstat (limited to 'geometry/geometry_tests')
-rw-r--r-- | geometry/geometry_tests/region_test.cpp | 25 |
1 files 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<m2::RegionU>(); - TestContaints<m2::RegionD>(); TestContaints<m2::RegionI>(); // negative triangle @@ -171,6 +169,27 @@ UNIT_TEST(Region_Contains) } } +UNIT_TEST(Region_Contains_uint32) +{ + TestContaints<m2::RegionU>(); +} + +UNIT_TEST(Region_Contains_double) +{ + TestContaints<m2::RegionD>(); + + { + typedef m2::PointD P; + m2::Region<P> 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<P::value_type>(0, 2, 8, 7), ()); + + TEST(!region.Contains(P(3, 5)), ()); + } +} + template <class TPoint> class PointsSummator { TPoint & m_res; |