Add visibility_tests.

This commit is contained in:
vng 2012-04-20 14:05:57 +03:00 committed by Alex Zolotarev
parent acc8e5bcdf
commit 567a594e8c
2 changed files with 26 additions and 0 deletions

View file

@ -35,3 +35,4 @@ SOURCES += \
geometry_serialization_test.cpp \
mwm_set_test.cpp \
categories_test.cpp \
visibility_test.cpp

View 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));
}
}