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

Function MakeTestSet1

generator/generator_tests/hierarchy_tests.cpp:19–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17using namespace generator::tests_support;
18
19std::vector<feature::FeatureBuilder> MakeTestSet1()
20{
21 std::vector<feature::FeatureBuilder> fbs;
22 {
23 feature::FeatureBuilder outline;
24 outline.AddPolygon({{0.0, 0.0}, {0.0, 10.0}, {10.0, 10.0}, {10.0, 0.0}});
25 outline.AddOsmId(base::MakeOsmWay(1));
26 outline.AddType(classif().GetTypeByPath({"building"}));
27 outline.AddType(classif().GetTypeByPath({"tourism", "attraction"}));
28 outline.SetArea();
29 fbs.emplace_back(outline);
30 }
31 {
32 feature::FeatureBuilder buildingPart;
33 buildingPart.AddPolygon({{0.0, 0.0}, {0.0, 8.0}, {8.0, 8.0}, {8.0, 0.0}});
34 buildingPart.AddOsmId(base::MakeOsmWay(2));
35 buildingPart.AddType(classif().GetTypeByPath({"building:part"}));
36 buildingPart.SetArea();
37 fbs.emplace_back(buildingPart);
38 }
39 {
40 feature::FeatureBuilder buildingPart;
41 buildingPart.AddPolygon({{0.0, 0.0}, {0.0, 7.0}, {7.0, 7.0}, {7.0, 0.0}});
42 buildingPart.AddOsmId(base::MakeOsmWay(3));
43 buildingPart.AddType(classif().GetTypeByPath({"building:part"}));
44 buildingPart.SetArea();
45 fbs.emplace_back(buildingPart);
46 }
47 {
48 feature::FeatureBuilder buildingPart;
49 buildingPart.AddPolygon({{0.0, 0.0}, {0.0, 6.0}, {6.0, 6.0}, {6.0, 0.0}});
50 buildingPart.AddOsmId(base::MakeOsmWay(4));
51 buildingPart.AddType(classif().GetTypeByPath({"building:part"}));
52 buildingPart.SetArea();
53 fbs.emplace_back(buildingPart);
54 }
55
56 return fbs;
57}
58
59void TestDepthNodeById(generator::hierarchy::HierarchyLinker::Node::Ptr const & tree, uint64_t id, size_t depth)
60{

Callers 1

UNIT_CLASS_TESTFunction · 0.85

Calls 7

MakeOsmWayFunction · 0.85
AddPolygonMethod · 0.80
AddOsmIdMethod · 0.80
GetTypeByPathMethod · 0.80
SetAreaMethod · 0.80
AddTypeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected