Skip to content
Snippets Groups Projects
Commit 2beaa1ec authored by Ziqi Zhou's avatar Ziqi Zhou
Browse files

test: modify corresponding tests

parent 29daa61c
No related branches found
No related tags found
No related merge requests found
......@@ -890,8 +890,7 @@ TEST(IMapConverterTest,
testing::internal::CaptureStdout();
const auto expected_warning_output =
"[RoadLogicSuite] WARN: The size of boundary points in road 0 section start 0 m lane -1 is less than 2, "
"downsampling is skipped, please check corresponding roadmarks in map file!\n";
"[RoadLogicSuite] WARN: Cannot simplify a polyline with less than two points. Downsampling is skipped!\n";
EXPECT_NO_THROW(converter.Convert(data_storage));
......
......@@ -61,7 +61,16 @@ TEST(ConverterUtilsTest, GivenLineWithLessThanTwoPoints_WhenDownsampling_ThenDie
{
const std::vector<mantle_api::Vec3<units::length::meter_t>> polyline = {
{units::length::meter_t(0.0), units::length::meter_t(0.0), units::length::meter_t(0.0)}};
EXPECT_THROW(road_logic_suite::DecimatePolyline(polyline.begin(), polyline.end(), 0.0), std::runtime_error);
testing::internal::CaptureStdout();
const auto expected_warning_output =
"[RoadLogicSuite] WARN: Cannot simplify a polyline with less than two points. Downsampling is skipped!\n";
EXPECT_NO_THROW(road_logic_suite::DecimatePolyline(polyline.begin(), polyline.end(), 0.0));
std::string console_output = testing::internal::GetCapturedStdout();
EXPECT_EQ(console_output, expected_warning_output);
}
TEST(ConverterUtilsTest, GivenLineWithTwoPoints_WhenDownsampling_ThenNoPointsAreRemoved)
......
......@@ -22,8 +22,7 @@ TEST_F(MapConvertIntegrationTestFixture,
testing::internal::CaptureStdout();
const auto expected_warning_output =
"[RoadLogicSuite] WARN: The size of boundary points in road 100 section start 0 m lane -2 is less than 2, "
"downsampling is skipped, please check corresponding roadmarks in map file!\n";
"[RoadLogicSuite] WARN: Cannot simplify a polyline with less than two points. Downsampling is skipped!\n";
EXPECT_NO_THROW(GetMap(GetResolvedMapPathInternal("roadmarks_in_edge_case.xodr")));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment