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

Function MakeFbForTest

generator/generator_tests/place_processor_tests.cpp:53–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51};
52
53feature::FeatureBuilder MakeFbForTest(generator_tests::Tags const & tags, OsmElement::EntityType t,
54 std::vector<m2::PointD> && points)
55{
56 auto element = generator_tests::MakeOsmElement(GetIdGen().GetId(), tags, t);
57 feature::FeatureBuilder result;
58 ftype::GetNameAndType(&element, result.GetParams());
59 if (element.IsNode())
60 {
61 CHECK_EQUAL(points.size(), 1, ());
62 result.SetOsmId(base::MakeOsmNode(element.m_id));
63 result.SetCenter(points.front());
64 }
65 else if (element.IsRelation() || element.IsWay())
66 {
67 result.AssignPoints(std::move(points));
68 CHECK(result.IsGeometryClosed(), ());
69 result.SetArea();
70
71 result.SetOsmId(element.IsRelation() ? base::MakeOsmRelation(element.m_id) : base::MakeOsmWay(element.m_id));
72 }
73 return result;
74}
75
76bool TestTable(generator::OsmIdToBoundariesTable & table,
77 std::set<std::pair<std::vector<base::GeoObjectId>, size_t>> const & answer)

Callers 2

MakeAreaFunction · 0.70
UNIT_CLASS_TESTFunction · 0.70

Calls 15

MakeOsmElementFunction · 0.85
GetNameAndTypeFunction · 0.85
MakeOsmNodeFunction · 0.85
MakeOsmRelationFunction · 0.85
MakeOsmWayFunction · 0.85
GetParamsMethod · 0.80
frontMethod · 0.80
IsRelationMethod · 0.80
IsGeometryClosedMethod · 0.80
SetAreaMethod · 0.80
GetIdMethod · 0.45
IsNodeMethod · 0.45

Tested by

no test coverage detected