Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2014-12-23 17:47:13 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:37:16 +0300
commitcbd4aee3e286626d5f931e516b4f15e97a202d01 (patch)
tree76d4e5cf71fcd738c7567e0e6f762f06007d8249 /geometry/geometry_tests/region_test.cpp
parent2d7f7c3b4b44ec85d57bf3777b78d1d689ffffeb (diff)
Finding and writing exit nodes
Diffstat (limited to 'geometry/geometry_tests/region_test.cpp')
-rw-r--r--geometry/geometry_tests/region_test.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/geometry/geometry_tests/region_test.cpp b/geometry/geometry_tests/region_test.cpp
index c075a8838a..d35570a92f 100644
--- a/geometry/geometry_tests/region_test.cpp
+++ b/geometry/geometry_tests/region_test.cpp
@@ -193,3 +193,22 @@ UNIT_TEST(Region_ForEachPoint)
TEST_EQUAL(res, P(11.5, 14.5), ());
}
+
+UNIT_TEST(Region_point_at_border_test)
+{
+ typedef m2::PointF P;
+ P const points[] = { P(0.0, 1.0), P(0.0, 10.0), P(10.0, 10.0), P(10.0, 1.0) };
+ m2::Region<P> region(points, points + ARRAY_SIZE(points));
+
+ P p1(0, 0);
+ P p2(5.0, 5.0);
+ P p3(0.0, 1.0);
+ P p4(5.0, 1.0);
+ P p5(5.0, 1.01);
+
+ TEST(!region.atBorder(p1, 0.01), ("Point lies outside border"));
+ TEST(!region.atBorder(p2, 0.01), ("Point lies inside but not at border"));
+ TEST(region.atBorder(p3, 0.01), ("Point has same point with border"));
+ TEST(region.atBorder(p4, 0.01), ("Point lies at border"));
+ TEST(region.atBorder(p5, 0.01), ("Point lies at delta interval near border"));
+}