Repository navigation
test(rclcpp_lifecycle): add unit tests for LifecycleNode::create_generic_publisher - #3396
Aaravanand00 wants to merge 1 commit into
Conversation
|
Hi @fujitatomoya @clalancette While reviewing the recent addition of This pr fills that gap by adding unit tests covering successful initialization, topic name validation, invalid typesupport error handling, custom publisher options, and message publishing. This improves test coverage for |
ABI Compliance Check✅ Verdict: compatible
✅
|
clalancette
left a comment
There was a problem hiding this comment.
My comments below are mostly because our test times are already through the roof, and I don't want to add in new tests unless they add something substantial. Let me know what you think.
…ric_publisher Signed-off-by: Aaravanand <aaravanand@gmail.com>
7afadb2 to
a00cbd3
Compare
Description
This pull request adds unit test coverage for
LifecycleNode::create_generic_publisherinrclcpp_lifecycle.While
create_generic_subscriptionwas recently introduced alongsidetest_lifecycle_generic_subscription.cpp,LifecycleNode::create_generic_publisherlacked dedicated unit tests. This PR introducesrclcpp_lifecycle/test/test_lifecycle_generic_publisher.cppand registers it inrclcpp_lifecycle/CMakeLists.txt.The new test suite covers :-
creation_and_destruction: Creation with valid topic name, typesupport string (test_msgs/msg/Strings), and QoS; verifies topic name accessor.invalid_topic_name: Verifies that passing an invalid topic name throwsrclcpp::exceptions::InvalidTopicNameError.invalid_topic_type: Verifies that passing an invalid/unregistered typesupport string throws astd::runtime_error.custom_publisher_options: Verifies passing customrclcpp::PublisherOptionswith an explicit callback group.publish_serialized_message: Verifies publishing arclcpp::SerializedMessagevia the generic publisher without throwing.Is this user-facing behavior change?
Did you use Generative AI?
Yes I was used to assist with structuring and writing the unit test cases and CMake registration.
Additional Information
ament_cpplint(0 problems found).ament_uncrustify(0 code style divergence).