Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add test with no lights #36

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions autoware_lanelet2_extension/test/src/test_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ TEST_F(TestSuite, QueryLanelets) // NOLINT for gtest
ASSERT_EQ(1U, crosswalk_lanelets.size()) << "failed to retrieve crosswalk lanelets";
}

TEST_F(TestSuite, NoTrafficLightsTest) // NOLINT for gtest
{
// create a map without traffic lights
lanelet::LaneletMapPtr map_without_tl = std::make_shared<lanelet::LaneletMap>();

// add road lanelet to the map
map_without_tl->add(sample_map_ptr->laneletLayer.front()); // no traffic light

auto traffic_lights = lanelet::utils::query::trafficLights(map_without_tl->laneletLayer);
ASSERT_EQ(0U, traffic_lights.size()) << "No traffic lights should be retrieved";

auto autoware_traffic_lights =
lanelet::utils::query::autowareTrafficLights(map_without_tl->laneletLayer);
ASSERT_EQ(0U, autoware_traffic_lights.size()) << "No Autoware traffic lights should be retrieved";
}

TEST_F(TestSuite, QueryTrafficLights) // NOLINT for gtest
{
lanelet::ConstLanelets all_lanelets = lanelet::utils::query::laneletLayer(sample_map_ptr);
Expand Down
Loading