Skip to content

Commit 1564c8a

Browse files
committed
fix: use assert from gtest
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
1 parent 8583607 commit 1564c8a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sensing/pointcloud_preprocessor/test/test_distortion_corrector_node.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ class DistortionCorrectorTest : public ::testing::Test
6767

6868
void TearDown() override {}
6969

70+
void checkInput(int ms) { ASSERT_LT(ms, 1000) << "ms should be less than a second."; }
71+
7072
rclcpp::Time addMilliseconds(rclcpp::Time stamp, int ms)
7173
{
72-
assert(ms < 1000 && "input ms should be less than a second.");
74+
checkInput(ms);
7375
auto ms_in_ns = rclcpp::Duration(0, ms * 1000000);
7476
return stamp + ms_in_ns;
7577
}
7678

7779
rclcpp::Time subtractMilliseconds(rclcpp::Time stamp, int ms)
7880
{
79-
assert(ms < 1000 && "input ms should be less than a second.");
81+
checkInput(ms);
8082
auto ms_in_ns = rclcpp::Duration(0, ms * 1000000);
8183
return stamp - ms_in_ns;
8284
}
@@ -220,6 +222,7 @@ class DistortionCorrectorTest : public ::testing::Test
220222
pointcloud_msg.width = 0;
221223
pointcloud_msg.row_step = 0;
222224
}
225+
223226
return pointcloud_msg;
224227
}
225228

0 commit comments

Comments
 (0)