Files
comaps/map/style_tests/dashes_test.cpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

39 lines
1.0 KiB
C++

#include "testing/testing.hpp"
#include "helpers.hpp"
#include "drape/stipple_pen_resource.hpp"
#include "drape_frontend/visual_params.hpp"
#include "indexer/classificator_loader.hpp"
#include "indexer/drawing_rules.hpp"
#include "indexer/drules_include.hpp"
UNIT_TEST(Test_Dashes)
{
styles::RunForEveryMapStyle([](MapStyle)
{
drule::rules().ForEachRule([](drule::BaseRule const * rule)
{
LineRuleProto const * const line = rule->GetLine();
if (nullptr == line || !line->has_dashdot())
return;
DashDotProto const & dd = line->dashdot();
int const n = dd.dd_size();
if (n > 0)
{
TEST_GREATER_OR_EQUAL(n, 2, ());
TEST_LESS_OR_EQUAL(n, 4, ());
for (int i = 0; i < n; ++i)
{
double const value = dd.dd(i);
TEST_GREATER_OR_EQUAL(value, 0.0, ());
}
double const patternLength = (dd.dd(0) + dd.dd(1)) * df::kMaxVisualScale;
TEST_LESS_OR_EQUAL(patternLength, dp::kMaxStipplePenLength, (dd.dd(0), dd.dd(1)));
}
});
});
}