MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/map/style_tests/dashes_test.cpp:10–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "indexer/drules_include.hpp"
9
10UNIT_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}

Callers

nothing calls this directly

Calls 6

RunForEveryMapStyleFunction · 0.85
ForEachRuleMethod · 0.80
has_dashdotMethod · 0.60
dd_sizeMethod · 0.60
ddMethod · 0.60
GetLineMethod · 0.45

Tested by

no test coverage detected