From 21a3d9b341e0d41fadb99ad492b04e0dce566ef3 Mon Sep 17 00:00:00 2001 From: Hans Oersted <80969277+HansOersted@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:34:59 +0100 Subject: [PATCH] feat: add the lanelet length test (#39) * lanelet length test added. Signed-off-by: Zhe Shen * style(pre-commit): autofix * compare the precise values Signed-off-by: Zhe Shen --------- Signed-off-by: Zhe Shen Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yutaka Kondo --- autoware_lanelet2_extension/test/src/test_utilities.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoware_lanelet2_extension/test/src/test_utilities.cpp b/autoware_lanelet2_extension/test/src/test_utilities.cpp index 9e35506..f1777bd 100644 --- a/autoware_lanelet2_extension/test/src/test_utilities.cpp +++ b/autoware_lanelet2_extension/test/src/test_utilities.cpp @@ -159,6 +159,15 @@ TEST_F(TestSuite, OverwriteLaneletsCenterline) // NOLINT for gtest } } +TEST_F(TestSuite, GetLaneletLength) // NOLINT for gtest +{ + double length_2d = lanelet::utils::getLaneletLength2d(road_lanelet); + double length_3d = lanelet::utils::getLaneletLength3d(road_lanelet); + + EXPECT_DOUBLE_EQ(length_2d, 1.0); + EXPECT_DOUBLE_EQ(length_3d, 1.0); +} + /* TEST(Utilities, copyZ) // NOLINT for gtest {