MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / GraphFixture

Method GraphFixture

unit_tests/util/static_rtree.cpp:132–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130struct GraphFixture
131{
132 GraphFixture(const std::vector<std::pair<FloatLongitude, FloatLatitude>> &input_coords,
133 const std::vector<std::tuple<unsigned, unsigned, bool>> &input_edges)
134 {
135
136 for (unsigned i = 0; i < input_coords.size(); i++)
137 {
138 coords.emplace_back(input_coords[i].first, input_coords[i].second);
139 }
140
141 for (const auto &pair : input_edges)
142 {
143 TestData d;
144 d.u = std::get<0>(pair);
145 d.v = std::get<1>(pair);
146 // We set the forward nodes to the target node-based-node IDs, just
147 // so we have something to test against. Because this isn't a real
148 // graph, the actual values aren't important, we just need something
149 // to examine during tests.
150 d.forward_segment_id = {std::get<1>(pair), true};
151 d.reverse_segment_id = {std::get<0>(pair), true};
152 d.fwd_segment_position = 0;
153 d.is_startpoint = std::get<2>(pair);
154 edges.emplace_back(d);
155 }
156 }
157
158 std::vector<Coordinate> coords;
159 std::vector<TestData> edges;

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected