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

Function CheckPriority

libs/map/style_tests/classificator_tests.cpp:168–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void CheckPriority(vector<base::StringIL> const & arrT, vector<size_t> const & arrI, drule::TypeT ruleType)
169{
170 Classificator const & c = classif();
171 vector<vector<uint32_t>> types;
172 vector<vector<string>> typesInfo;
173
174 styles::RunForEveryMapStyle([&](MapStyle)
175 {
176 types.clear();
177 typesInfo.clear();
178
179 size_t ind = 0;
180 for (size_t i = 0; i < arrI.size(); ++i)
181 {
182 types.push_back(vector<uint32_t>());
183 types.back().reserve(arrI[i]);
184 typesInfo.push_back(vector<string>());
185 typesInfo.back().reserve(arrI[i]);
186
187 for (size_t j = 0; j < arrI[i]; ++j)
188 {
189 types.back().push_back(c.GetTypeByPath(arrT[ind]));
190 typesInfo.back().push_back(CombineArrT(arrT[ind]));
191 ++ind;
192 }
193 }
194
195 TEST_EQUAL(ind, arrT.size(), ());
196
197 for (int level = scales::GetUpperWorldScale() + 1; level <= scales::GetUpperStyleScale(); ++level)
198 {
199 pair<int, int> minmax(numeric_limits<int>::max(), numeric_limits<int>::min());
200 vector<string> minmaxInfo;
201 for (size_t i = 0; i < types.size(); ++i)
202 {
203 pair<int, int> const mm = GetMinMax(level, types[i], ruleType);
204 TEST_LESS(minmax.second, mm.first,
205 ("Priority bug on zoom", level, "group", i, ":", minmaxInfo, minmax.first, minmax.second, "vs",
206 typesInfo[i], mm.first, mm.second));
207 minmax = mm;
208 minmaxInfo = typesInfo[i];
209 }
210 }
211 });
212}
213
214} // namespace
215

Callers 1

UNIT_TESTFunction · 0.85

Calls 11

RunForEveryMapStyleFunction · 0.85
CombineArrTFunction · 0.85
GetUpperWorldScaleFunction · 0.85
GetUpperStyleScaleFunction · 0.85
GetMinMaxFunction · 0.85
backMethod · 0.80
GetTypeByPathMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected