From 1296279724101d00f093874c69a1cf4e25f46c8a Mon Sep 17 00:00:00 2001 From: IsiGebauer Date: Tue, 17 Dec 2024 13:50:12 +0100 Subject: [PATCH] added test --- generator/generator_tests/osm_type_test.cpp | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index 55dfcee87c..3ea2b33085 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -3166,4 +3166,36 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_MultipleComplexTypesSmoke) } } +UNIT_CLASS_TEST(TestWithClassificator, OsmType_Mtb_Rating) +{ + using Type = std::vector; + std::vector> const conversions = { + {{"highway", "cycleway", "easy"}, {{"highway", "cycleway"}, {"mtb:scale", "0"}, {"smoothness", "good"}}}, + {{"highway", "cycleway", "easy"}, {{"highway", "cycleway"}, {"mtb:scale", "S0"}}}, + {{"highway", "cycleway", "easy"}, {{"highway", "cycleway"}, {"mtb:scale:imba", "1"}}}, + {{"highway", "cycleway", "easy"}, {{"highway", "cycleway"}, {"smoothness", "bad"}}}, + + {{"highway", "cycleway", "intermediate"}, {{"highway", "cycleway"}, {"mtb:scale", "1"}, {"smoothness", "good"}}}, + {{"highway", "cycleway", "intermediate"}, {{"highway", "cycleway"}, {"mtb:scale", "S2"}}}, + {{"highway", "cycleway", "intermediate"}, {{"highway", "cycleway"}, {"mtb:scale:imba", "2"}}}, + {{"highway", "cycleway", "intermediate"}, {{"highway", "cycleway"}, {"smoothness", "horrible"}}}, + + {{"highway", "cycleway", "difficult"}, {{"highway", "cycleway"}, {"mtb:scale", "3"}, {"smoothness", "very_bad"}}}, + {{"highway", "cycleway", "difficult"}, {{"highway", "cycleway"}, {"mtb:scale", "S3"}}}, + {{"highway", "cycleway", "difficult"}, {{"highway", "cycleway"}, {"mtb:scale:imba", "3"}, {"smoothness", "bad"}}}, + {{"highway", "cycleway", "difficult"}, {{"highway", "cycleway"}, {"smoothness", "very_horrible"}}}, + + {{"highway", "cycleway", "expert"}, {{"highway", "cycleway"}, {"mtb:scale", "4"}, {"smoothness", "very_bad"}}}, + {{"highway", "cycleway", "expert"}, {{"highway", "cycleway"}, {"mtb:scale", "S5"}}}, + {{"highway", "cycleway", "expert"}, {{"highway", "cycleway"}, {"mtb:scale:imba", "4"}, {"smoothness", "bad"}}} + + }; + + for (auto const & type : conversions) + { + auto const params = GetFeatureBuilderParams(type.second); + TEST(params.IsTypeExist(GetType(type.first)), (type, params)); + } +} + } // namespace osm_type_test