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>2012-10-09 15:04:40 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:45:02 +0300
commitebf3bccf1765fb4700c4cdd868ce372408016c08 (patch)
tree19732123a2ea401d8aaf210809e4be8853b06fa3 /generator/generator_tests/classificator_tests.cpp
parent546372dd085c2e16834e3630d682b554403f8ca6 (diff)
[generator] Add test for checking consistency of types.txt and classificator.txt
Diffstat (limited to 'generator/generator_tests/classificator_tests.cpp')
-rw-r--r--generator/generator_tests/classificator_tests.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/generator/generator_tests/classificator_tests.cpp b/generator/generator_tests/classificator_tests.cpp
new file mode 100644
index 0000000000..dc5b7f52b3
--- /dev/null
+++ b/generator/generator_tests/classificator_tests.cpp
@@ -0,0 +1,30 @@
+#include "../../testing/testing.hpp"
+
+#include "../../indexer/classificator.hpp"
+#include "../../indexer/classificator_loader.hpp"
+
+#include "../../base/logging.hpp"
+
+
+namespace
+{
+ class DoCheckConsistency
+ {
+ Classificator const & m_c;
+ public:
+ DoCheckConsistency() : m_c(classif()) {}
+ void operator() (ClassifObject const * p, uint32_t type)
+ {
+ if (p->IsDrawableAny() && !m_c.IsTypeValid(type))
+ TEST(false, ("Inconsistency type", type, m_c.GetFullObjectName(type)));
+ }
+ };
+}
+
+UNIT_TEST(Classificator_CheckConsistency)
+{
+ classificator::Load();
+
+ DoCheckConsistency doCheck;
+ classif().ForEachTree(doCheck);
+}