Skip to content

Commit

Permalink
Merge pull request #49 from ArthurVal/add/linear_feedback_controller_…
Browse files Browse the repository at this point in the history
…unittests

Add the 'LinearFeedbackController' unit-tests
  • Loading branch information
MaximilienNaveau authored Feb 6, 2025
2 parents b5d24a9 + 82873e9 commit 05d4121
Show file tree
Hide file tree
Showing 8 changed files with 646 additions and 87 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ if(BUILD_TESTING)

ament_auto_add_gtest(test_lf_controller tests/test_lf_controller.cpp)
target_link_libraries(test_lf_controller ${PROJECT_NAME})

ament_auto_add_gtest(test_linear_feedback_controller
tests/test_linear_feedback_controller.cpp)
target_link_libraries(test_linear_feedback_controller ${PROJECT_NAME})
endif()

#
Expand Down
22 changes: 5 additions & 17 deletions tests/test_lf_controller.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <sstream>
#include <string_view>
#include <tuple>

Expand Down Expand Up @@ -234,23 +235,10 @@ INSTANTIATE_TEST_SUITE_P(
{.name = "l12"},
},
})),
[](auto&& info) {
std::string str;
if (info.param.has_free_flyer) {
str.append("FreeFlyer_");
}

str.append(std::to_string(size(info.param.joint_list)));
str.append("_Joints");

for (const auto& [name, type] : info.param.joint_list) {
str.append("_");
str.append(name);
str.append("_");
str.append(ToString(type));
}

return str;
[](const auto& info) {
std::stringstream stream;
PrintTo(info.param, &stream, {.as_param_name = true});
return stream.str();
});

} // namespace
Loading

0 comments on commit 05d4121

Please sign in to comment.