Skip to content

Commit

Permalink
Clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marip8 committed Oct 12, 2022
1 parent f4a045c commit 5a27478
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tesseract_command_language/src/composite_instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const std::string& CompositeInstruction::getProfile(const std::string& ns) const
{
if (ns.empty() || (profile_overrides_.find(ns) == profile_overrides_.end()))
return profile_;
else
return profile_overrides_.at(ns);

return profile_overrides_.at(ns);
}

void CompositeInstruction::setProfileOverrides(ProfileOverrides profile_overrides)
Expand Down
8 changes: 4 additions & 4 deletions tesseract_command_language/src/move_instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,17 @@ const std::string& MoveInstruction::getProfile(const std::string& ns) const
{
if (ns.empty() || (profile_overrides_.find(ns) == profile_overrides_.end()))
return profile_;
else
return profile_overrides_.at(ns);

return profile_overrides_.at(ns);
}

void MoveInstruction::setPathProfile(const std::string& profile) { path_profile_ = profile; }
const std::string& MoveInstruction::getPathProfile(const std::string& ns) const
{
if (ns.empty() || (path_profile_overrides_.find(ns) == path_profile_overrides_.end()))
return path_profile_;
else
return path_profile_overrides_.at(ns);

return path_profile_overrides_.at(ns);
}

void MoveInstruction::setProfileOverrides(ProfileOverrides profile_overrides)
Expand Down
2 changes: 1 addition & 1 deletion tesseract_command_language/test/move_instruction_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ TEST(TesseractCommandLanguageMoveInstructionPolyUnit, boostSerialization) // NO
EXPECT_FALSE(child_ninstr.getParentUUID().is_nil());
}

TEST(TesseractCommandLanguageMoveInstructionPolyUnit, ProfileOverrides)
TEST(TesseractCommandLanguageMoveInstructionPolyUnit, ProfileOverrides) // NOLINT
{
Eigen::VectorXd jv = Eigen::VectorXd::Ones(6);
std::vector<std::string> jn = { "j1", "j2", "j3", "j4", "j5", "j6" };
Expand Down
14 changes: 7 additions & 7 deletions tesseract_motion_planners/test/profile_dictionary_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,27 @@ TEST(TesseractPlanningProfileDictionaryUnit, ProfileDictionaryTest) // NOLINT
{
ProfileDictionary profiles;

EXPECT_THROW(profiles.getProfile<ProfileBase>("ns", "key"), std::runtime_error);
EXPECT_THROW(profiles.getProfile<ProfileBase>("ns", "key"), std::runtime_error); // NOLINT

profiles.addProfile<ProfileBase>("ns", "key", std::make_shared<ProfileTest>());

ProfileBase::ConstPtr profile;
ASSERT_NO_THROW(profile = profiles.getProfile<ProfileBase>("ns", "key"));
ASSERT_NO_THROW(profile = profiles.getProfile<ProfileBase>("ns", "key")); // NOLINT

ASSERT_TRUE(profile != nullptr);
EXPECT_EQ(profile->a, 0);

// Check add same profile with different key
profiles.addProfile<ProfileBase>("ns", "key2", profile);
ProfileBase::ConstPtr profile2;
ASSERT_NO_THROW(profile2 = profiles.getProfile<ProfileBase>("ns", "key2"));
ASSERT_NO_THROW(profile2 = profiles.getProfile<ProfileBase>("ns", "key2")); // NOLINT
ASSERT_TRUE(profile2 != nullptr);
EXPECT_EQ(profile2->a, 0);

// Check replacing a profile
profiles.addProfile<ProfileBase>("ns", "key", std::make_shared<ProfileTest>(10));
ProfileBase::ConstPtr profile_check;
ASSERT_NO_THROW(profile_check = profiles.getProfile<ProfileBase>("ns", "key"));
ASSERT_NO_THROW(profile_check = profiles.getProfile<ProfileBase>("ns", "key")); // NOLINT
ASSERT_TRUE(profile_check != nullptr);
EXPECT_EQ(profile_check->a, 10);

Expand All @@ -91,7 +91,7 @@ TEST(TesseractPlanningProfileDictionaryUnit, ProfileDictionaryTest) // NOLINT

profiles.addProfile<ProfileBase>("ns", "key", std::make_shared<ProfileTest>(20));
ProfileBase::ConstPtr profile_check2;
ASSERT_NO_THROW(profile_check2 = profiles.getProfile<ProfileBase>("ns", "key"));
ASSERT_NO_THROW(profile_check2 = profiles.getProfile<ProfileBase>("ns", "key")); // NOLINT
ASSERT_TRUE(profile_check2 != nullptr);
EXPECT_EQ(profile_check2->a, 20);

Expand All @@ -117,12 +117,12 @@ TEST(TesseractPlanningProfileDictionaryUnit, ProfileDictionaryTest) // NOLINT
profiles.addProfile<ProfileBase2>("ns", "key", std::make_shared<ProfileTest2>(5));
EXPECT_TRUE(profiles.hasProfileEntry<ProfileBase2>("ns"));
ProfileBase2::ConstPtr profile_check3;
ASSERT_NO_THROW(profile_check3 = profiles.getProfile<ProfileBase2>("ns", "key"));
ASSERT_NO_THROW(profile_check3 = profiles.getProfile<ProfileBase2>("ns", "key")); // NOLINT
ASSERT_TRUE(profile_check3 != nullptr);
EXPECT_EQ(profile_check3->b, 5);
// Check that other profile entry with same key is not affected
ProfileBase::ConstPtr profile_check4;
ASSERT_NO_THROW(profile_check4 = profiles.getProfile<ProfileBase>("ns", "key"));
ASSERT_NO_THROW(profile_check4 = profiles.getProfile<ProfileBase>("ns", "key")); // NOLINT
ASSERT_TRUE(profile_check4 != nullptr);
EXPECT_EQ(profile_check4->a, 20);
}
Expand Down

0 comments on commit 5a27478

Please sign in to comment.