Skip to content

Commit

Permalink
Add text to assertions references (#1023)
Browse files Browse the repository at this point in the history
This should make debugging failed tests easier.
  • Loading branch information
fmauch authored May 19, 2023
1 parent 7174a1d commit 775dd6a
Showing 1 changed file with 14 additions and 7 deletions.
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

0 comments on commit 775dd6a

Please sign in to comment.