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.

(cherry picked from commit 775dd6a)

# Conflicts:
#	controller_manager/test/test_hardware_management_srvs.cpp
  • Loading branch information
fmauch authored and mergify[bot] committed May 19, 2023
1 parent 9bc92ab commit 1f1b511
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions controller_manager/test/test_hardware_management_srvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,25 @@ class TestControllerManagerHWManagementSrvs : public TestControllerManagerSrvs
const std::string & name, const std::string & type, const std::string & class_type,
const uint8_t state_id, const std::string & state_label)
{
<<<<<<< HEAD
EXPECT_EQ(component.name, name);
EXPECT_EQ(component.type, type);
EXPECT_EQ(component.class_type, class_type);
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.";
>>>>>>> 775dd6a (Add text to assertions references (#1023))
}

void list_hardware_components_and_check(
Expand Down Expand Up @@ -124,8 +138,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 1f1b511

Please sign in to comment.