From 567a594e8c206e81c0b07a9434570b528ca249c9 Mon Sep 17 00:00:00 2001 From: vng Date: Fri, 20 Apr 2012 14:05:57 +0300 Subject: [PATCH] Add visibility_tests. --- indexer/indexer_tests/indexer_tests.pro | 1 + indexer/indexer_tests/visibility_test.cpp | 25 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 indexer/indexer_tests/visibility_test.cpp diff --git a/indexer/indexer_tests/indexer_tests.pro b/indexer/indexer_tests/indexer_tests.pro index c9aff80c27..63e93d4e65 100644 --- a/indexer/indexer_tests/indexer_tests.pro +++ b/indexer/indexer_tests/indexer_tests.pro @@ -35,3 +35,4 @@ SOURCES += \ geometry_serialization_test.cpp \ mwm_set_test.cpp \ categories_test.cpp \ + visibility_test.cpp diff --git a/indexer/indexer_tests/visibility_test.cpp b/indexer/indexer_tests/visibility_test.cpp new file mode 100644 index 0000000000..6a97e1252e --- /dev/null +++ b/indexer/indexer_tests/visibility_test.cpp @@ -0,0 +1,25 @@ +#include "../../testing/testing.hpp" + +#include "../feature_data.hpp" +#include "../feature_visibility.hpp" +#include "../classificator.hpp" +#include "../scales.hpp" + + +UNIT_TEST(VisibleScales_Smoke) +{ + { + char const * arr[] = { "place", "city", "capital" }; + + feature::TypesHolder types; + types(classif().GetTypeByPath(vector(arr, arr + 3))); + + pair const r = feature::GetDrawableScaleRange(types); + TEST_NOT_EQUAL(r.first, -1, ()); + TEST_LESS_OR_EQUAL(r.first, r.second, ()); + + TEST(my::between_s(r.first, r.second, 10), (r)); + TEST(!my::between_s(r.first, r.second, 1), (r)); + TEST(!my::between_s(r.first, r.second, scales::GetUpperScale()), (r)); + } +}