Skip to content

Commit

Permalink
Fix new clang-tidy remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
aobolensk committed Nov 1, 2024
1 parent c5d88cd commit 1e10b0e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 45 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Checks: >
bugprone-unused-raii,
bugprone-unused-return-value,
clang-diagnostic-*,
cppcoreguidelines-avoid-goto,
llvm-include-order,
llvm-namespace-comment,
misc-confusable-identifiers,
Expand Down
88 changes: 44 additions & 44 deletions modules/core/task/func_tests/task_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ TEST(task_tests, check_int32_t) {
std::vector<int32_t> out(1, 0);

// Create TaskData
auto taskData = std::make_shared<ppc::core::TaskData>();
taskData->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
taskData->inputs_count.emplace_back(in.size());
taskData->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
taskData->outputs_count.emplace_back(out.size());
auto task_data = std::make_shared<ppc::core::TaskData>();
task_data->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
task_data->inputs_count.emplace_back(in.size());
task_data->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
task_data->outputs_count.emplace_back(out.size());

// Create Task
ppc::test::task::TestTask<int32_t> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, true);
ppc::test::task::TestTask<int32_t> testTask(task_data);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, true);
testTask.pre_processing();
testTask.run();
testTask.post_processing();
Expand All @@ -33,16 +33,16 @@ TEST(task_tests, check_validate_func) {
std::vector<int32_t> out(2, 0);

// Create TaskData
auto taskData = std::make_shared<ppc::core::TaskData>();
taskData->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
taskData->inputs_count.emplace_back(in.size());
taskData->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
taskData->outputs_count.emplace_back(out.size());
auto task_data = std::make_shared<ppc::core::TaskData>();
task_data->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
task_data->inputs_count.emplace_back(in.size());
task_data->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
task_data->outputs_count.emplace_back(out.size());

// Create Task
ppc::test::task::TestTask<int32_t> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, false);
ppc::test::task::TestTask<int32_t> testTask(task_data);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, false);
}

TEST(task_tests, check_double) {
Expand All @@ -51,16 +51,16 @@ TEST(task_tests, check_double) {
std::vector<double> out(1, 0);

// Create TaskData
auto taskData = std::make_shared<ppc::core::TaskData>();
taskData->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
taskData->inputs_count.emplace_back(in.size());
taskData->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
taskData->outputs_count.emplace_back(out.size());
auto task_data = std::make_shared<ppc::core::TaskData>();
task_data->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
task_data->inputs_count.emplace_back(in.size());
task_data->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
task_data->outputs_count.emplace_back(out.size());

// Create Task
ppc::test::task::TestTask<double> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, true);
ppc::test::task::TestTask<double> testTask(task_data);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, true);
testTask.pre_processing();
testTask.run();
testTask.post_processing();
Expand All @@ -73,16 +73,16 @@ TEST(task_tests, check_uint8_t) {
std::vector<uint8_t> out(1, 0);

// Create TaskData
auto taskData = std::make_shared<ppc::core::TaskData>();
taskData->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
taskData->inputs_count.emplace_back(in.size());
taskData->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
taskData->outputs_count.emplace_back(out.size());
auto task_data = std::make_shared<ppc::core::TaskData>();
task_data->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
task_data->inputs_count.emplace_back(in.size());
task_data->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
task_data->outputs_count.emplace_back(out.size());

// Create Task
ppc::test::task::TestTask<uint8_t> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, true);
ppc::test::task::TestTask<uint8_t> testTask(task_data);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, true);
testTask.pre_processing();
testTask.run();
testTask.post_processing();
Expand All @@ -103,8 +103,8 @@ TEST(task_tests, check_int64_t) {

// Create Task
ppc::test::task::TestTask<int64_t> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, true);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, true);
testTask.pre_processing();
testTask.run();
testTask.post_processing();
Expand All @@ -125,8 +125,8 @@ TEST(task_tests, check_float) {

// Create Task
ppc::test::task::TestTask<float> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, true);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, true);
testTask.pre_processing();
testTask.run();
testTask.post_processing();
Expand All @@ -139,16 +139,16 @@ TEST(task_tests, check_wrong_order) {
std::vector<float> out(1, 0);

// Create TaskData
auto taskData = std::make_shared<ppc::core::TaskData>();
taskData->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
taskData->inputs_count.emplace_back(in.size());
taskData->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
taskData->outputs_count.emplace_back(out.size());
auto task_data = std::make_shared<ppc::core::TaskData>();
task_data->inputs.emplace_back(reinterpret_cast<uint8_t *>(in.data()));
task_data->inputs_count.emplace_back(in.size());
task_data->outputs.emplace_back(reinterpret_cast<uint8_t *>(out.data()));
task_data->outputs_count.emplace_back(out.size());

// Create Task
ppc::test::task::TestTask<float> testTask(taskData);
bool isValid = testTask.validation();
ASSERT_EQ(isValid, true);
ppc::test::task::TestTask<float> testTask(task_data);
bool is_valid = testTask.validation();
ASSERT_EQ(is_valid, true);
testTask.pre_processing();
ASSERT_ANY_THROW(testTask.post_processing());
}
Expand Down

0 comments on commit 1e10b0e

Please sign in to comment.