Skip to content

Commit

Permalink
Test cases were added, and the source code was reverted to its pre-mo…
Browse files Browse the repository at this point in the history
…dified state so that the added test cases would fail.

Signed-off-by: Masaya Kataoka <[email protected]>
  • Loading branch information
hakuturu583 committed Dec 23, 2024
1 parent c1fc434 commit 211b0ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions simulation/traffic_simulator/src/utils/pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ auto canonicalize(
if (lanelet_pose == LaneletPose()) {
return std::nullopt;
} else {
try {
return CanonicalizedLaneletPose(lanelet_pose, hdmap_utils_ptr);
} catch (const common::SemanticError &) {
return std::nullopt;
}
return CanonicalizedLaneletPose(lanelet_pose, hdmap_utils_ptr);
}
}

Expand Down
2 changes: 2 additions & 0 deletions simulation/traffic_simulator/test/src/utils/test_pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ TEST_F(PoseTest, canonicalize_invalid)
traffic_simulator::pose::canonicalize(
traffic_simulator::pose::quietNaNLaneletPose(), hdmap_utils),
std::runtime_error);
EXPECT_FALSE(traffic_simulator::pose::canonicalize(
traffic_simulator::helper::constructLaneletPose(203, 1000.0, 0.0), hdmap_utils));
}

/**
Expand Down

0 comments on commit 211b0ad

Please sign in to comment.