Skip to content

Commit 287b7ed

Browse files
committed
Add test case for expressions as logging param
Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
1 parent 3fc9992 commit 287b7ed

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rclcpp/test/rclcpp/test_logging.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ TEST_F(TestLoggingMacros, test_throttle) {
229229
}
230230
}
231231

232+
TEST_F(TestLoggingMacros, test_parameter_expression) {
233+
RCLCPP_DEBUG_STREAM(*&g_logger, "message");
234+
EXPECT_EQ(1u, g_log_calls);
235+
EXPECT_EQ("message", g_last_log_event.message);
236+
}
237+
232238
bool log_function(rclcpp::Logger logger)
233239
{
234240
RCLCPP_INFO(logger, "successful log");

0 commit comments

Comments
 (0)