forked from organicmaps/organicmaps
Add visibility_tests.
This commit is contained in:
parent
acc8e5bcdf
commit
567a594e8c
2 changed files with 26 additions and 0 deletions
|
@ -35,3 +35,4 @@ SOURCES += \
|
|||
geometry_serialization_test.cpp \
|
||||
mwm_set_test.cpp \
|
||||
categories_test.cpp \
|
||||
visibility_test.cpp
|
||||
|
|
25
indexer/indexer_tests/visibility_test.cpp
Normal file
25
indexer/indexer_tests/visibility_test.cpp
Normal file
|
@ -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<string>(arr, arr + 3)));
|
||||
|
||||
pair<int, int> 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));
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue