Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jun 23, 2023
1 parent ad9821f commit eaa7c97
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct TaskComposerInput

TaskComposerInput(TaskComposerProblem::UPtr problem);
TaskComposerInput(const TaskComposerInput&) = delete;
TaskComposerInput(TaskComposerInput&&) noexcept = delete;
TaskComposerInput& operator=(const TaskComposerInput&) = delete;
TaskComposerInput& operator=(TaskComposerInput&&) = delete;
virtual ~TaskComposerInput() = default;
Expand Down
2 changes: 1 addition & 1 deletion tesseract_task_composer/core/src/task_composer_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TaskComposerNode::TaskComposerNode(std::string name, TaskComposerNodeType type,
}

TaskComposerNode::TaskComposerNode(std::string name, TaskComposerNodeType type, const YAML::Node& config)
: TaskComposerNode::TaskComposerNode(name, type)
: TaskComposerNode::TaskComposerNode(std::move(name), type)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP

namespace tesseract_planning
{
TaskComposerPipeline::TaskComposerPipeline(std::string name) : TaskComposerPipeline(name, true) {}
TaskComposerPipeline::TaskComposerPipeline(std::string name) : TaskComposerPipeline(std::move(name), true) {}
TaskComposerPipeline::TaskComposerPipeline(std::string name, bool conditional)
: TaskComposerGraph(std::move(name), TaskComposerNodeType::PIPELINE, conditional)
{
Expand Down
2 changes: 1 addition & 1 deletion tesseract_task_composer/core/src/task_composer_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP

namespace tesseract_planning
{
TaskComposerTask::TaskComposerTask(std::string name) : TaskComposerTask(name, true) {}
TaskComposerTask::TaskComposerTask(std::string name) : TaskComposerTask(std::move(name), true) {}
TaskComposerTask::TaskComposerTask(std::string name, bool conditional)
: TaskComposerNode(std::move(name), TaskComposerNodeType::TASK, conditional)
{
Expand Down
70 changes: 35 additions & 35 deletions tesseract_task_composer/test/tesseract_task_composer_core_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerNodeTests) // NOLINT
EXPECT_TRUE(node->getInputKeys().empty());
EXPECT_TRUE(node->getOutputKeys().empty());
EXPECT_FALSE(node->isConditional());
EXPECT_NO_THROW(node->dump(os));
EXPECT_NO_THROW(node->dump(os)); // NOLINT

// Setters
std::string name{ "TaskComposerNodeTests" };
Expand All @@ -171,7 +171,7 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerNodeTests) // NOLINT
EXPECT_EQ(node->getInputKeys(), input_keys);
EXPECT_EQ(node->getOutputKeys(), output_keys);
EXPECT_EQ(node->isConditional(), true);
EXPECT_NO_THROW(node->dump(os));
EXPECT_NO_THROW(node->dump(os)); // NOLINT

// Utils
std::map<std::string, std::string> rename_input_keys{ { "I1", "I3" }, { "I2", "I4" } };
Expand All @@ -180,7 +180,7 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerNodeTests) // NOLINT
node->renameOutputKeys(rename_output_keys);
EXPECT_EQ(node->getInputKeys(), std::vector<std::string>({ "I3", "I4" }));
EXPECT_EQ(node->getOutputKeys(), std::vector<std::string>({ "O3", "O4" }));
EXPECT_NO_THROW(node->dump(os));
EXPECT_NO_THROW(node->dump(os)); // NOLINT

// Serialization
test_suite::runSerializationPointerTest(node, "TaskComposerNodeTests");
Expand Down Expand Up @@ -262,7 +262,7 @@ class TestTask : public TaskComposerTask
}

TaskComposerNodeInfo::UPtr runImpl(TaskComposerInput& input,
OptionalTaskComposerExecutor /*executor*/ = std::nullopt) const
OptionalTaskComposerExecutor /*executor*/ = std::nullopt) const override final
{
if (throw_exception)
throw std::runtime_error("TestTask, failure");
Expand Down Expand Up @@ -311,8 +311,8 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerTaskTests) // NOLINT
EXPECT_EQ(input.task_infos.getInfoMap().at(task->getUUID())->return_value, 0);

std::stringstream os;
EXPECT_NO_THROW(task->dump(os));
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(task->dump(os)); // NOLINT
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap())); // NOLINT
}

{ // Conditional
Expand All @@ -334,8 +334,8 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerTaskTests) // NOLINT
EXPECT_EQ(input.task_infos.getInfoMap().at(task->getUUID())->return_value, 1);

std::stringstream os;
EXPECT_NO_THROW(task->dump(os));
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(task->dump(os)); // NOLINT
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap())); // NOLINT
}

{
Expand Down Expand Up @@ -363,8 +363,8 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerTaskTests) // NOLINT
EXPECT_EQ(input.task_infos.getInfoMap().at(task->getUUID())->return_value, 0);

std::stringstream os;
EXPECT_NO_THROW(task->dump(os));
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(task->dump(os)); // NOLINT
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap())); // NOLINT
}

{
Expand Down Expand Up @@ -393,8 +393,8 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerTaskTests) // NOLINT
EXPECT_EQ(input.task_infos.getInfoMap().at(task->getUUID())->return_value, 1);

std::stringstream os;
EXPECT_NO_THROW(task->dump(os));
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(task->dump(os)); // NOLINT
EXPECT_NO_THROW(task->dump(os, nullptr, input.task_infos.getInfoMap())); // NOLINT
}

{ // Failure due to exception during run
Expand Down Expand Up @@ -499,12 +499,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test1a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test1b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -554,12 +554,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test2a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test2b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -610,12 +610,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test3a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test3b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -666,12 +666,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test4a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test4b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -724,12 +724,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test5a.dot");
EXPECT_NO_THROW(pipeline3->dump(os1));
EXPECT_NO_THROW(pipeline3->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test5b.dot");
EXPECT_NO_THROW(pipeline3->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline3->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -784,12 +784,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test6a.dot");
EXPECT_NO_THROW(pipeline3->dump(os1));
EXPECT_NO_THROW(pipeline3->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test6b.dot");
EXPECT_NO_THROW(pipeline3->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline3->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -845,12 +845,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test7a.dot");
EXPECT_NO_THROW(pipeline3->dump(os1));
EXPECT_NO_THROW(pipeline3->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test7b.dot");
EXPECT_NO_THROW(pipeline3->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline3->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -1014,12 +1014,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test8a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test8b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand All @@ -1045,12 +1045,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test9a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test9b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand All @@ -1075,12 +1075,12 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerPipelineTests) // NOLINT

std::ofstream os1;
os1.open(tesseract_common::getTempPath() + "task_composer_pipeline_test10a.dot");
EXPECT_NO_THROW(pipeline->dump(os1));
EXPECT_NO_THROW(pipeline->dump(os1)); // NOLINT
os1.close();

std::ofstream os2;
os2.open(tesseract_common::getTempPath() + "task_composer_pipeline_test10b.dot");
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap()));
EXPECT_NO_THROW(pipeline->dump(os2, nullptr, input.task_infos.getInfoMap())); // NOLINT
os2.close();
}

Expand Down Expand Up @@ -1687,7 +1687,7 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerStartTaskTests) // NOLINT
std::string str = R"(config:
conditional: true)";
YAML::Node config = YAML::Load(str);
EXPECT_ANY_THROW(std::make_unique<StartTask>("abc", config["config"], factory));
EXPECT_ANY_THROW(std::make_unique<StartTask>("abc", config["config"], factory)); // NOLINT
}

{ // Construction failure
Expand All @@ -1697,7 +1697,7 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerStartTaskTests) // NOLINT
inputs: [input_data]
ouputs: [output_data])";
YAML::Node config = YAML::Load(str);
EXPECT_ANY_THROW(std::make_unique<StartTask>("abc", config["config"], factory));
EXPECT_ANY_THROW(std::make_unique<StartTask>("abc", config["config"], factory)); // NOLINT
}

{ // Construction failure
Expand All @@ -1706,7 +1706,7 @@ TEST(TesseractTaskComposerCoreUnit, TaskComposerStartTaskTests) // NOLINT
conditional: false
outputs: [output_data])";
YAML::Node config = YAML::Load(str);
EXPECT_ANY_THROW(std::make_unique<StartTask>("abc", config["config"], factory));
EXPECT_ANY_THROW(std::make_unique<StartTask>("abc", config["config"], factory)); // NOLINT
}

{ // Serialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP

using namespace tesseract_planning;

void runTaskComposerFactoryTest(TaskComposerPluginFactory factory, YAML::Node plugin_config)
void runTaskComposerFactoryTest(TaskComposerPluginFactory& factory, YAML::Node plugin_config)
{
const YAML::Node& plugin_info = plugin_config[tesseract_common::TaskComposerPluginInfo::CONFIG_KEY];
const YAML::Node& search_paths = plugin_info["search_paths"];
Expand Down

0 comments on commit eaa7c97

Please sign in to comment.