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:
authorvng <viktor.govako@gmail.com>2013-09-21 21:52:59 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:02:14 +0300
commit1677cd9cf2d44d4ee9dcc1581b862196439732ea (patch)
tree1e226fde797c776a66b2c427f87d8088f5149148 /generator/generator_tests/classificator_tests.cpp
parent7008290a6e8a18179dd3a150fd715856fd210d85 (diff)
[styles] More drawing rules tests.
Diffstat (limited to 'generator/generator_tests/classificator_tests.cpp')
-rw-r--r--generator/generator_tests/classificator_tests.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/generator/generator_tests/classificator_tests.cpp b/generator/generator_tests/classificator_tests.cpp
index 61e848e005..878d841c5e 100644
--- a/generator/generator_tests/classificator_tests.cpp
+++ b/generator/generator_tests/classificator_tests.cpp
@@ -60,18 +60,28 @@ public:
if (range.first == -1 || range.second == -1)
LOG(LINFO, ("No styles:", type, m_c.GetFullObjectName(type)));
}
+ else if (ftype::GetLevel(type) > 1)
+ LOG(LINFO, ("Type without any rules:", type, m_c.GetFullObjectName(type)));
}
};
-void ForEachObject(Classificator const & c, string const & name,
+void ForEachObject(Classificator const & c, vector<string> const & path,
EGeomType geomType, int rules)
{
- vector<string> v;
- v.push_back(name);
- uint32_t const type = c.GetTypeByPath(v);
+ uint32_t const type = c.GetTypeByPath(path);
+ ClassifObject const * pObj = c.GetObject(type);
DoCheckStyles doCheck(c, geomType, rules);
- c.GetObject(type)->ForEachObjectInTree(doCheck, type);
+ doCheck(pObj, type);
+ pObj->ForEachObjectInTree(doCheck, type);
+}
+
+void ForEachObject(Classificator const & c, string const & name,
+ EGeomType geomType, int rules)
+{
+ vector<string> path;
+ strings::Tokenize(name, "-", MakeBackInsertFunctor(path));
+ ForEachObject(c, path, geomType, rules);
}
void CheckPointStyles(Classificator const & c, string const & name)
@@ -91,6 +101,7 @@ UNIT_TEST(Classificator_DrawingRules)
classificator::Load();
Classificator const & c = classif();
+ LOG(LINFO, ("--------------- Point styles ---------------"));
CheckPointStyles(c, "landuse");
CheckPointStyles(c, "amenity");
CheckPointStyles(c, "historic");
@@ -99,7 +110,13 @@ UNIT_TEST(Classificator_DrawingRules)
CheckPointStyles(c, "shop");
CheckPointStyles(c, "sport");
CheckPointStyles(c, "tourism");
+ CheckPointStyles(c, "highway-bus_stop");
+ CheckPointStyles(c, "highway-motorway_junction");
+ CheckPointStyles(c, "railway-station");
+ CheckPointStyles(c, "railway-tram_stop");
+ CheckPointStyles(c, "railway-halt");
+ LOG(LINFO, ("--------------- Linear styles ---------------"));
CheckLineStyles(c, "highway");
CheckLineStyles(c, "waterway");
//CheckLineStyles(c, "railway");