Skip to content

Commit

Permalink
Update system name
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagyar committed Jan 13, 2024
1 parent db6bbd1 commit bf3f514
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions hardware_interface/test/mock_components/test_generic_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TestGenericSystem : public ::testing::Test
// REMOVE THIS MEMBER ONCE FAKE COMPONENTS ARE REMOVED
hardware_fake_system_2dof_ =
R"(
<ros2_control name="GenericSystem2dof" type="system">
<ros2_control name="MockHardwareSystem" type="system">
<hardware>
<plugin>fake_components/GenericSystem</plugin>
</hardware>
Expand Down Expand Up @@ -645,7 +645,7 @@ void set_components_state(

auto configure_components = [](
TestableResourceManager & rm,
const std::vector<std::string> & components = {"GenericSystem2dof"})
const std::vector<std::string> & components = {"MockHardwareSystem"})
{
set_components_state(
rm, components, lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE,
Expand All @@ -654,7 +654,7 @@ auto configure_components = [](

auto activate_components = [](
TestableResourceManager & rm,
const std::vector<std::string> & components = {"GenericSystem2dof"})
const std::vector<std::string> & components = {"MockHardwareSystem"})
{
set_components_state(
rm, components, lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE,
Expand All @@ -663,7 +663,7 @@ auto activate_components = [](

auto deactivate_components = [](
TestableResourceManager & rm,
const std::vector<std::string> & components = {"GenericSystem2dof"})
const std::vector<std::string> & components = {"MockHardwareSystem"})
{
set_components_state(
rm, components, lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE,
Expand Down Expand Up @@ -794,17 +794,17 @@ void generic_system_functional_test(const std::string & urdf, const double offse
// check is hardware is configured
auto status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::UNCONFIGURED);
configure_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::INACTIVE);
activate_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::ACTIVE);

// Check initial values
Expand Down Expand Up @@ -884,7 +884,7 @@ void generic_system_functional_test(const std::string & urdf, const double offse
deactivate_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::INACTIVE);
}

Expand Down Expand Up @@ -1324,18 +1324,18 @@ TEST_F(TestGenericSystem, generic_system_2dof_functionality_with_offset_custom_i
// check is hardware is configured
auto status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::UNCONFIGURED);

configure_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::INACTIVE);
activate_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::ACTIVE);

// Check initial values
Expand Down Expand Up @@ -1425,7 +1425,7 @@ TEST_F(TestGenericSystem, generic_system_2dof_functionality_with_offset_custom_i
deactivate_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::INACTIVE);
}

Expand All @@ -1438,17 +1438,17 @@ TEST_F(TestGenericSystem, valid_urdf_ros2_control_system_robot_with_gpio)
// check is hardware is started
auto status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::UNCONFIGURED);
configure_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::INACTIVE);
activate_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::ACTIVE);

ASSERT_EQ(8u, rm.state_interface_keys().size());
Expand Down Expand Up @@ -1534,17 +1534,17 @@ void TestGenericSystem::test_generic_system_with_mock_gpio_commands(std::string
// check is hardware is started
auto status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::UNCONFIGURED);
configure_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::INACTIVE);
activate_components(rm);
status_map = rm.get_components_status();
EXPECT_EQ(
status_map["GenericSystem2dof"].state.label(),
status_map["MockHardwareSystem"].state.label(),
hardware_interface::lifecycle_state_names::ACTIVE);

// Check interfaces
Expand Down

0 comments on commit bf3f514

Please sign in to comment.