From 7479deacbd1e6547675cbc4d64cb45fa532c81e4 Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Fri, 4 Jul 2025 14:23:51 +0200 Subject: [PATCH] refactor: remove global using directives --- modules/util/include/func_test_util.hpp | 14 +++++------ modules/util/include/perf_test_util.hpp | 31 ++++++++++++------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/modules/util/include/func_test_util.hpp b/modules/util/include/func_test_util.hpp index e43b59e7..5be35e73 100644 --- a/modules/util/include/func_test_util.hpp +++ b/modules/util/include/func_test_util.hpp @@ -16,12 +16,10 @@ #include "task/include/task.hpp" #include "util/include/util.hpp" -using namespace ppc::task; - namespace ppc::util { template -using FuncTestParam = std::tuple(InType)>, std::string, TestType>; +using FuncTestParam = std::tuple(InType)>, std::string, TestType>; template using GTestFuncParam = ::testing::TestParamInfo>; @@ -98,7 +96,7 @@ class BaseRunFuncTests : public ::testing::TestWithParam task_; + ppc::task::TaskPtr task_; }; template @@ -115,10 +113,10 @@ auto ExpandToValues(const Tuple& t) { template auto GenTaskTuplesImpl(const SizesContainer& sizes, const std::string& settings_path, std::index_sequence /*unused*/) { - return std::make_tuple(std::make_tuple( - TaskGetter, - std::string(GetNamespace()) + "_" + GetStringTaskType(Task::GetStaticTypeOfTask(), settings_path), - sizes[Is])...); + return std::make_tuple(std::make_tuple(ppc::task::TaskGetter, + std::string(GetNamespace()) + "_" + + ppc::task::GetStringTaskType(Task::GetStaticTypeOfTask(), settings_path), + sizes[Is])...); } template diff --git a/modules/util/include/perf_test_util.hpp b/modules/util/include/perf_test_util.hpp index 66afefd1..16f66cfb 100644 --- a/modules/util/include/perf_test_util.hpp +++ b/modules/util/include/perf_test_util.hpp @@ -18,17 +18,14 @@ #include "task/include/task.hpp" #include "util/include/util.hpp" -using namespace ppc::task; -using namespace ppc::performance; - namespace ppc::util { double GetTimeMPI(); int GetMPIRank(); template -using PerfTestParam = - std::tuple(InType)>, std::string, PerfResults::TypeOfRunning>; +using PerfTestParam = std::tuple(InType)>, std::string, + ppc::performance::PerfResults::TypeOfRunning>; template /// @brief Base class for performance testing of parallel tasks. @@ -38,7 +35,7 @@ class BaseRunPerfTests : public ::testing::TestWithParam>& info) { - return GetStringParamName(std::get(info.param)) + "_" + + return ppc::performance::GetStringParamName(std::get(info.param)) + "_" + std::get(info.param); } @@ -47,7 +44,7 @@ class BaseRunPerfTests : public ::testing::TestWithParamGetDynamicTypeOfTask() == ppc::task::TypeOfTask::kMPI || task_->GetDynamicTypeOfTask() == ppc::task::TypeOfTask::kALL) { const double t0 = GetTimeMPI(); @@ -80,13 +77,13 @@ class BaseRunPerfTests : public ::testing::TestWithParam task_; + ppc::task::TaskPtr task_; }; template auto MakePerfTaskTuples(const std::string& settings_path) { - const auto name = - std::string(GetNamespace()) + "_" + GetStringTaskType(TaskType::GetStaticTypeOfTask(), settings_path); + const auto name = std::string(GetNamespace()) + "_" + + ppc::task::GetStringTaskType(TaskType::GetStaticTypeOfTask(), settings_path); - return std::make_tuple(std::make_tuple(TaskGetter, name, PerfResults::TypeOfRunning::kPipeline), - std::make_tuple(TaskGetter, name, PerfResults::TypeOfRunning::kTaskRun)); + return std::make_tuple(std::make_tuple(ppc::task::TaskGetter, name, + ppc::performance::PerfResults::TypeOfRunning::kPipeline), + std::make_tuple(ppc::task::TaskGetter, name, + ppc::performance::PerfResults::TypeOfRunning::kTaskRun)); } template