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

controller_manager_srvs tests: Add text to assertions #1023

Merged
merged 1 commit into from
May 19, 2023
Merged
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
21 changes: 14 additions & 7 deletions controller_manager/test/test_hardware_management_srvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs
const std::string & name, const std::string & type, const std::string & plugin_name,
const uint8_t state_id, const std::string & state_label)
{
EXPECT_EQ(component.name, name);
EXPECT_EQ(component.type, type);
EXPECT_EQ(component.plugin_name, plugin_name);
EXPECT_EQ(component.state.id, state_id);
EXPECT_EQ(component.state.label, state_label);
EXPECT_EQ(component.name, name) << "Component has unexpected name.";
EXPECT_EQ(component.type, type)
<< "Component " << name << " from plugin " << plugin_name << " has wrong type.";
EXPECT_EQ(component.plugin_name, plugin_name)
<< "Component " << name << " (" << type << ") has unexpected plugin_name.";
EXPECT_EQ(component.state.id, state_id)
<< "Component " << name << " (" << type << ") from plugin " << plugin_name
<< " has wrong state_id.";
EXPECT_EQ(component.state.label, state_label)
<< "Component " << name << " (" << type << ") from plugin " << plugin_name
<< " has wrong state_label.";
}

void list_hardware_components_and_check(
Expand Down Expand Up @@ -124,8 +130,9 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs
{
auto it = std::find(interface_names.begin(), interface_names.end(), interfaces[i].name);
EXPECT_NE(it, interface_names.end());
EXPECT_EQ(interfaces[i].is_available, is_available_status[i]);
EXPECT_EQ(interfaces[i].is_claimed, is_claimed_status[i]);
EXPECT_EQ(interfaces[i].is_available, is_available_status[i])
<< "At " << interfaces[i].name;
EXPECT_EQ(interfaces[i].is_claimed, is_claimed_status[i]) << "At " << interfaces[i].name;
}
};

Expand Down