Skip to content

Commit

Permalink
Fix remarks from uncrustify and cpplint
Browse files Browse the repository at this point in the history
Unfortunately both differ in the rules so that e.g.
cpplint expects two spaces between code and comment while
uncrustify says it's okay with a single space

Signed-off-by: Nico Neumann <nico.neumann@iosb.fraunhofer.de>
  • Loading branch information
Nico Neumann committed Oct 15, 2021
1 parent 381a9e6 commit 3983af8
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions rclcpp/test/rclcpp/test_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2607,7 +2607,7 @@ TEST_F(TestNode, declare_parameter_allowed_simple_types_function_templates) {
node->declare_parameter<int>(name2, 1234);
node->declare_parameter<int64_t>(name3, 12340);
node->declare_parameter<float>(name4, static_cast<float>(12.34));
node->declare_parameter<double>(name5, 12.34); // called float64 in ros2 design parameters page
node->declare_parameter<double>(name5, 12.34); // called float64 in ros2 design parameters page
node->declare_parameter<std::string>(name6, "test string");
auto str = "test param";
node->declare_parameter<const char *>(name7, str);
Expand Down Expand Up @@ -2644,7 +2644,7 @@ TEST_F(TestNode, declare_parameter_allowed_simple_types_function_templates) {
node->declare_parameter<int>(name2, 4321);
node->declare_parameter<int64_t>(name3, 43210);
node->declare_parameter<float>(name4, static_cast<float>(43.21));
node->declare_parameter<double>(name5, 12.34); // called float64 in ros2 design parameters page
node->declare_parameter<double>(name5, 12.34); // called float64 in ros2 design parameters page
node->declare_parameter<std::string>(name6, "test string");
auto str = "test param";
node->declare_parameter<const char *>(name7, str);
Expand Down Expand Up @@ -2681,9 +2681,15 @@ TEST_F(TestNode, declare_parameter_allowed_array_types_function_templates) {
node->declare_parameter<std::vector<bool>>(name2, bool_arr);
node->declare_parameter<std::vector<int>>(name3, std::vector<int>{1234, 2345});
node->declare_parameter<std::vector<int64_t>>(name4, std::vector<int64_t>{12340, 9876});
node->declare_parameter<std::vector<float>>(name5, std::vector<float>{static_cast<float>(12.34), static_cast<float>(98.78)});
node->declare_parameter<std::vector<double>>(name6, std::vector<double>{12.34, 55.66}); // called float64 in ros2 design parameters page
node->declare_parameter<std::vector<std::string>>(name7, std::vector<std::string>{"test string", "another test str"});
node->declare_parameter<std::vector<float>>(
name5, std::vector<float>{static_cast<float>(12.34),
static_cast<float>(98.78)});
node->declare_parameter<std::vector<double>>(
name6,
std::vector<double>{12.34, 55.66}); // called float64 in ros2 design parameters page
node->declare_parameter<std::vector<std::string>>(
name7, std::vector<std::string>{"test string",
"another test str"});

EXPECT_TRUE(node->has_parameter(name1));
EXPECT_TRUE(node->has_parameter(name2));
Expand Down Expand Up @@ -2718,9 +2724,15 @@ TEST_F(TestNode, declare_parameter_allowed_array_types_function_templates) {
node->declare_parameter<std::vector<bool>>(name2, std::vector<bool>{true, false, true});
node->declare_parameter<std::vector<int>>(name3, std::vector<int>{22, 33, 55, 77});
node->declare_parameter<std::vector<int64_t>>(name4, std::vector<int64_t>{456, 765});
node->declare_parameter<std::vector<float>>(name5, std::vector<float>{static_cast<float>(99.11), static_cast<float>(11.99)});
node->declare_parameter<std::vector<double>>(name6, std::vector<double>{12.21, 55.55, 98.89}); // called float64 in ros2 design parameters page
node->declare_parameter<std::vector<std::string>>(name7, std::vector<std::string>{"ros2", "colcon", "ignition"});
node->declare_parameter<std::vector<float>>(
name5, std::vector<float>{static_cast<float>(99.11),
static_cast<float>(11.99)});
node->declare_parameter<std::vector<double>>(
name6,
std::vector<double>{12.21, 55.55, 98.89}); // called float64 in ros2 design parameters page
node->declare_parameter<std::vector<std::string>>(
name7, std::vector<std::string>{"ros2",
"colcon", "ignition"});

std::vector<rclcpp::Parameter> expected = {
{name1, std::vector<uint8_t>{0xD, 0xE, 0xA, 0xD}},
Expand Down

0 comments on commit 3983af8

Please sign in to comment.