MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / test_geometry

Function test_geometry

LibCarla/source/test/client/test_opendrive.cpp:60–79  ·  view source on GitHub ↗

Geometry

Source from the content-addressed store, hash-verified

58
59// Geometry
60static void test_geometry(const pugi::xml_document &xml, boost::optional<Map>& map) {
61 pugi::xml_node open_drive_node = xml.child("OpenDRIVE");
62
63 for (pugi::xml_node road_node : open_drive_node.children("road")) {
64 RoadId road_id = road_node.attribute("id").as_uint();
65
66 for (pugi::xml_node plan_view_nodes : road_node.children("planView")) {
67 auto geometries_parser = plan_view_nodes.children("geometry");
68 auto total_geometries_parser = std::distance(geometries_parser.begin(), geometries_parser.end());
69 auto total_geometries = 0;
70 for (pugi::xml_node geometry_node : plan_view_nodes.children("geometry")){
71 float s = geometry_node.attribute("s").as_float();
72 auto geometry = map->GetMap().GetRoad(road_id).GetInfo<RoadInfoGeometry>(s);
73 if (geometry != nullptr)
74 ++total_geometries;
75 }
76 ASSERT_EQ(total_geometries, total_geometries_parser);
77 }
78 }
79}
80
81// Road test
82static auto get_total_road_marks(

Callers 1

TESTFunction · 0.85

Calls 9

childMethod · 0.80
childrenMethod · 0.80
as_uintMethod · 0.80
attributeMethod · 0.80
as_floatMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetRoadMethod · 0.45
GetMapMethod · 0.45

Tested by

no test coverage detected