diff options
author | vng <viktor.govako@gmail.com> | 2014-09-16 15:19:01 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:27:11 +0300 |
commit | 26a50dea3ad38596c485a4c600ba2d58659bfdf7 (patch) | |
tree | 204eca44dda5f4785a3c34d2fbe8b7505f1493a2 /routing/routing_tests/vehicle_model_test.cpp | |
parent | ce32dfb4ba33084a495374cf74c29d459fcbc570 (diff) |
[generator][classificator] Factor out additional tags for highways as the separate node in classificator:
- hwtag=oneway
- hwtag=private
- hwtag=lit
Diffstat (limited to 'routing/routing_tests/vehicle_model_test.cpp')
-rw-r--r-- | routing/routing_tests/vehicle_model_test.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/routing/routing_tests/vehicle_model_test.cpp b/routing/routing_tests/vehicle_model_test.cpp index 66b884fcf2..85e4f89b2e 100644 --- a/routing/routing_tests/vehicle_model_test.cpp +++ b/routing/routing_tests/vehicle_model_test.cpp @@ -29,7 +29,11 @@ uint32_t GetType(char const * s0, char const * s1 = 0, char const * s2 = 0) char const * const t[] = {s0, s1, s2}; size_t const size = (s0 != 0) + size_t(s1 != 0) + size_t(s2 != 0); return classif().GetTypeByPath(vector<string>(t, t + size)); +} +uint32_t GetOnewayType() +{ + return GetType("hwtag", "oneway"); } void CheckSpeed(vector<uint32_t> types, double expectedSpeed) @@ -50,7 +54,6 @@ void CheckOneWay(vector<uint32_t> types, bool expectedValue) TEST_EQUAL(vehicleModel.IsOneWay(h), expectedValue, ()); } - } UNIT_TEST(VehicleModel_MaxSpeed) @@ -97,17 +100,17 @@ UNIT_TEST(VehicleModel_Speed_MultiTypes) UNIT_TEST(VehicleModel_OneWay) { { - uint32_t types[] = { GetType("highway", "secondary", "bridge"), GetType("oneway") }; + uint32_t types[] = { GetType("highway", "secondary", "bridge"), GetOnewayType() }; CheckSpeed(vector<uint32_t>(types, types + ARRAY_SIZE(types)), 80.0); CheckOneWay(vector<uint32_t>(types, types + ARRAY_SIZE(types)), true); } { - uint32_t types[] = { GetType("oneway"), GetType("highway", "secondary", "bridge") }; + uint32_t types[] = { GetOnewayType(), GetType("highway", "secondary", "bridge") }; CheckSpeed(vector<uint32_t>(types, types + ARRAY_SIZE(types)), 80.0); CheckOneWay(vector<uint32_t>(types, types + ARRAY_SIZE(types)), true); } { - uint32_t types[] = { GetType("oneway") }; + uint32_t types[] = { GetOnewayType() }; CheckSpeed(vector<uint32_t>(types, types + ARRAY_SIZE(types)), 0.0); CheckOneWay(vector<uint32_t>(types, types + ARRAY_SIZE(types)), true); } @@ -124,7 +127,7 @@ UNIT_TEST(VehicleModel_DifferentSpeeds) CheckSpeed(vector<uint32_t>(types, types + ARRAY_SIZE(types)), 80.0); } { - uint32_t types[] = { GetType("highway", "primary"), GetType("oneway"), GetType("highway", "secondary") }; + uint32_t types[] = { GetType("highway", "primary"), GetOnewayType(), GetType("highway", "secondary") }; CheckSpeed(vector<uint32_t>(types, types + ARRAY_SIZE(types)), 80.0); CheckOneWay(vector<uint32_t>(types, types + ARRAY_SIZE(types)), true); } |