@@ -106,21 +106,55 @@ TEST(TypesupportHelpersTest, returns_service_type_info_for_valid_library) {
106
106
}
107
107
}
108
108
109
+ TEST (TypesupportHelpersTest, returns_action_type_info_for_valid_legacy_library) {
110
+ try {
111
+ auto library = rclcpp::get_typesupport_library (
112
+ " test_msgs/NestedMessage" , " rosidl_typesupport_cpp" );
113
+ auto nestedmessage_typesupport = rclcpp::get_action_typesupport_handle (
114
+ " test_msgs/NestedMessage" , " rosidl_typesupport_cpp" , *library);
115
+
116
+ EXPECT_THAT (
117
+ std::string (nestedmessage_typesupport->goal_service_type_support ->typesupport_identifier ),
118
+ ContainsRegex (" rosidl_typesupport" ));
119
+ } catch (const std::runtime_error & e) {
120
+ FAIL () << e.what ();
121
+ }
122
+ }
123
+
124
+ TEST (TypesupportHelpersTest, returns_action_type_info_for_valid_library) {
125
+ try {
126
+ auto library = rclcpp::get_typesupport_library (
127
+ " test_msgs/action/NestedMessage" , " rosidl_typesupport_cpp" );
128
+ auto nestedmessage_typesupport = rclcpp::get_action_typesupport_handle (
129
+ " test_msgs/action/NestedMessage" , " rosidl_typesupport_cpp" , *library);
130
+
131
+ EXPECT_THAT (
132
+ std::string (nestedmessage_typesupport->goal_service_type_support ->typesupport_identifier ),
133
+ ContainsRegex (" rosidl_typesupport" ));
134
+ } catch (const std::runtime_error & e) {
135
+ FAIL () << e.what ();
136
+ }
137
+ }
138
+
109
139
TEST (TypesupportHelpersTest, test_throw_exception_with_invalid_type) {
110
140
// message
111
141
std::string invalid_type = " test_msgs/msg/InvalidType" ;
112
142
auto library = rclcpp::get_typesupport_library (invalid_type, " rosidl_typesupport_cpp" );
113
143
EXPECT_THROW (
114
144
rclcpp::get_message_typesupport_handle (invalid_type, " rosidl_typesupport_cpp" , *library),
115
145
std::runtime_error);
116
- EXPECT_THROW (
117
- rclcpp::get_service_typesupport_handle (invalid_type, " rosidl_typesupport_cpp" , *library),
118
- std::runtime_error);
119
146
120
147
// service
121
148
invalid_type = " test_msgs/srv/InvalidType" ;
122
149
library = rclcpp::get_typesupport_library (invalid_type, " rosidl_typesupport_cpp" );
123
150
EXPECT_THROW (
124
151
rclcpp::get_service_typesupport_handle (invalid_type, " rosidl_typesupport_cpp" , *library),
125
152
std::runtime_error);
153
+
154
+ // action
155
+ invalid_type = " test_msgs/action/InvalidType" ;
156
+ library = rclcpp::get_typesupport_library (invalid_type, " rosidl_typesupport_cpp" );
157
+ EXPECT_THROW (
158
+ rclcpp::get_action_typesupport_handle (invalid_type, " rosidl_typesupport_cpp" , *library),
159
+ std::runtime_error);
126
160
}
0 commit comments