| 8 | #include "indexer/drules_include.hpp" |
| 9 | |
| 10 | UNIT_TEST(Test_Dashes) |
| 11 | { |
| 12 | styles::RunForEveryMapStyle([](MapStyle) |
| 13 | { |
| 14 | drule::rules().ForEachRule([](drule::BaseRule const * rule) |
| 15 | { |
| 16 | LineRuleProto const * const line = rule->GetLine(); |
| 17 | if (nullptr == line || !line->has_dashdot()) |
| 18 | return; |
| 19 | |
| 20 | DashDotProto const & dd = line->dashdot(); |
| 21 | |
| 22 | int const n = dd.dd_size(); |
| 23 | if (n > 0) |
| 24 | { |
| 25 | TEST_GREATER_OR_EQUAL(n, 2, ()); |
| 26 | TEST_LESS_OR_EQUAL(n, 4, ()); |
| 27 | for (int i = 0; i < n; ++i) |
| 28 | { |
| 29 | double const value = dd.dd(i); |
| 30 | TEST_GREATER_OR_EQUAL(value, 0.0, ()); |
| 31 | } |
| 32 | |
| 33 | double const patternLength = (dd.dd(0) + dd.dd(1)) * df::kMaxVisualScale; |
| 34 | TEST_LESS_OR_EQUAL(patternLength, dp::kMaxStipplePenLength, (dd.dd(0), dd.dd(1))); |
| 35 | } |
| 36 | }); |
| 37 | }); |
| 38 | } |
nothing calls this directly
no test coverage detected