Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WString tests #353

Merged
merged 1 commit into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test_communication/test/test_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ int main(int argc, char ** argv)
publish<test_msgs::msg::Defaults>(node, message, get_messages_defaults());
} else if (message == "Strings") {
publish<test_msgs::msg::Strings>(node, message, get_messages_strings());
} else if (message == "WStrings") {
publish<test_msgs::msg::WStrings>(node, message, get_messages_wstrings());
} else {
fprintf(stderr, "Unknown message argument '%s'\n", message.c_str());
rclcpp::shutdown();
Expand Down
5 changes: 5 additions & 0 deletions test_communication/test/test_publisher_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ int main(int argc, char ** argv)
auto messages_constants = get_messages_constants();
auto messages_defaults = get_messages_defaults();
auto messages_strings = get_messages_strings();
auto messages_wstrings = get_messages_wstrings();

std::thread spin_thread([node]() {
rclcpp::spin(node);
Expand Down Expand Up @@ -180,6 +181,10 @@ int main(int argc, char ** argv)
subscriber = subscribe<test_msgs::msg::Strings>(
node, message, messages_strings, received_messages);
publish<test_msgs::msg::Strings>(node, message, messages_strings);
} else if (message == "WStrings") {
subscriber = subscribe<test_msgs::msg::WStrings>(
node, message, messages_wstrings, received_messages);
publish<test_msgs::msg::WStrings>(node, message, messages_wstrings);
} else {
fprintf(stderr, "Unknown message argument '%s'\n", message.c_str());
return 1;
Expand Down
4 changes: 4 additions & 0 deletions test_communication/test/test_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ int main(int argc, char ** argv)
auto messages_constants = get_messages_constants();
auto messages_defaults = get_messages_defaults();
auto messages_strings = get_messages_strings();
auto messages_wstrings = get_messages_wstrings();

rclcpp::SubscriptionBase::SharedPtr subscriber;
std::vector<bool> received_messages; // collect flags about received messages
Expand Down Expand Up @@ -133,6 +134,9 @@ int main(int argc, char ** argv)
} else if (message == "Strings") {
subscriber = subscribe<test_msgs::msg::Strings>(
node, message, messages_strings, received_messages);
} else if (message == "WStrings") {
subscriber = subscribe<test_msgs::msg::WStrings>(
node, message, messages_wstrings, received_messages);
} else {
fprintf(stderr, "Unknown message argument '%s'\n", message.c_str());
rclcpp::shutdown();
Expand Down