Skip to content

Commit

Permalink
Adapt test to new way of exporting reference interfaces (Related to #…
Browse files Browse the repository at this point in the history
…1240 in ros2_control) (#1103)

---------

Co-authored-by: Bence Magyar <[email protected]>
  • Loading branch information
mamueluth and bmagyar authored Oct 7, 2024
1 parent 1004054 commit 9c5be9f
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ TEST_F(AckermannSteeringControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(reference_interfaces[i].get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(reference_interfaces[i]->get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ TEST_F(AckermannSteeringControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(reference_interfaces[i].get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(reference_interfaces[i]->get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ TEST_F(BicycleSteeringControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(reference_interfaces[i].get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(reference_interfaces[i]->get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ TEST_F(BicycleSteeringControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(reference_interfaces[i].get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(reference_interfaces[i]->get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down
6 changes: 3 additions & 3 deletions pid_controller/test/test_pid_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ TEST_F(PidControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + dof_name + "/" + interface;
EXPECT_EQ(ref_if_conf[ri_index].get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[ri_index].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[ri_index].get_interface_name(), dof_name + "/" + interface);
EXPECT_EQ(ref_if_conf[ri_index]->get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[ri_index]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[ri_index]->get_interface_name(), dof_name + "/" + interface);
++ri_index;
}
}
Expand Down
12 changes: 6 additions & 6 deletions pid_controller/test/test_pid_controller_preceding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ TEST_F(PidControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + dof_name + "/" + interface;
EXPECT_EQ(ref_if_conf[ri_index].get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[ri_index].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[ri_index].get_interface_name(), dof_name + "/" + interface);
EXPECT_EQ(ref_if_conf[ri_index]->get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[ri_index]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[ri_index]->get_interface_name(), dof_name + "/" + interface);
++ri_index;
}
}
Expand All @@ -101,10 +101,10 @@ TEST_F(PidControllerTest, check_exported_interfaces)
{
const std::string state_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + dof_name + "/" + interface;
EXPECT_EQ(exported_state_itfs[esi_index].get_name(), state_itf_name);
EXPECT_EQ(exported_state_itfs[esi_index]->get_name(), state_itf_name);
EXPECT_EQ(
exported_state_itfs[esi_index].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(exported_state_itfs[esi_index].get_interface_name(), dof_name + "/" + interface);
exported_state_itfs[esi_index]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(exported_state_itfs[esi_index]->get_interface_name(), dof_name + "/" + interface);
++esi_index;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ TEST_F(SteeringControllersLibraryTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(reference_interfaces[i].get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(reference_interfaces[i]->get_name(), ref_itf_name);
EXPECT_EQ(reference_interfaces[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(reference_interfaces[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ TEST_F(TricycleSteeringControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(ref_if_conf[i].get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(ref_if_conf[i]->get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ TEST_F(TricycleSteeringControllerTest, check_exported_interfaces)
{
const std::string ref_itf_name =
std::string(controller_->get_node()->get_name()) + "/" + joint_reference_interfaces_[i];
EXPECT_EQ(ref_if_conf[i].get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[i].get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[i].get_interface_name(), joint_reference_interfaces_[i]);
EXPECT_EQ(ref_if_conf[i]->get_name(), ref_itf_name);
EXPECT_EQ(ref_if_conf[i]->get_prefix_name(), controller_->get_node()->get_name());
EXPECT_EQ(ref_if_conf[i]->get_interface_name(), joint_reference_interfaces_[i]);
}
}

Expand Down

0 comments on commit 9c5be9f

Please sign in to comment.