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:
Diffstat (limited to 'geometry/geometry_tests/cellid_test.cpp')
-rw-r--r--geometry/geometry_tests/cellid_test.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/geometry/geometry_tests/cellid_test.cpp b/geometry/geometry_tests/cellid_test.cpp
index 07e7ed2ec7..a664f33e9e 100644
--- a/geometry/geometry_tests/cellid_test.cpp
+++ b/geometry/geometry_tests/cellid_test.cpp
@@ -49,6 +49,24 @@ UNIT_TEST(CellId_ToInt64)
TEST_EQUAL(m2::CellId<3>("33").ToInt64(3), 21, ());
}
+UNIT_TEST(CellId_ToInt64_LevelLessThanDepth)
+{
+ TEST_EQUAL(m2::CellId<3>("").ToInt64(2), 1, ());
+ TEST_EQUAL(m2::CellId<3>("0").ToInt64(2), 2, ());
+ TEST_EQUAL(m2::CellId<3>("1").ToInt64(2), 3, ());
+ TEST_EQUAL(m2::CellId<3>("2").ToInt64(2), 4, ());
+ TEST_EQUAL(m2::CellId<3>("3").ToInt64(2), 5, ());
+ TEST_EQUAL(m2::CellId<3>("00").ToInt64(2), 2, ());
+ TEST_EQUAL(m2::CellId<3>("01").ToInt64(2), 2, ());
+ TEST_EQUAL(m2::CellId<3>("03").ToInt64(2), 2, ());
+ TEST_EQUAL(m2::CellId<3>("10").ToInt64(2), 3, ());
+ TEST_EQUAL(m2::CellId<3>("20").ToInt64(2), 4, ());
+ TEST_EQUAL(m2::CellId<3>("23").ToInt64(2), 4, ());
+ TEST_EQUAL(m2::CellId<3>("30").ToInt64(2), 5, ());
+ TEST_EQUAL(m2::CellId<3>("31").ToInt64(2), 5, ());
+ TEST_EQUAL(m2::CellId<3>("33").ToInt64(2), 5, ());
+}
+
UNIT_TEST(CellId_FromInt64)
{
TEST_EQUAL(m2::CellId<3>(""), m2::CellId<3>::FromInt64(1, 3), ());