Skip to content

Commit 1148c77

Browse files
committed
Refactor test parameters to use GTestFuncParam alias
Replaced inline TestParamInfo definitions with the GTestFuncParam alias to improve readability and maintainability. This ensures consistent usage of type aliases across the codebase and reduces redundancy in test parameter handling.
1 parent c81c99b commit 1148c77

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

modules/core/util/include/test_util.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ inline std::string GetStringParamName(ppc::core::PerfResults::TypeOfRunning type
2222
template <typename InType, typename OutType, typename TestType = void>
2323
using FuncTestParam = std::tuple<std::function<ppc::core::TaskPtr<InType, OutType>(InType)>, std::string, TestType>;
2424

25+
template <typename InType, typename OutType, typename TestType = void>
26+
using GTestFuncParam = ::testing::TestParamInfo<ppc::util::FuncTestParam<InType, OutType, TestType>>;
27+
2528
template <typename InType, typename OutType>
2629
using PerfTestParam = FuncTestParam<InType, OutType, ppc::core::PerfResults::TypeOfRunning>;
2730

tasks/example/tests/func_tests/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ class NesterovARunFuncTests : public ppc::util::BaseRunFuncTests<InType, OutType
2323
InType input_data_;
2424

2525
public:
26-
static std::string CustomFuncTestName(
27-
const ::testing::TestParamInfo<ppc::util::FuncTestParam<InType, OutType, TestType>> &info) {
26+
static std::string CustomFuncTestName(const ppc::util::GTestFuncParam<InType, OutType, TestType> &info) {
2827
std::string test_name = std::get<ppc::util::FuncTestParamIndex::kNameTest>(info.param);
2928
std::string test_param = std::to_string(std::get<ppc::util::FuncTestParamIndex::kTestParams>(info.param));
3029
return test_name + "_" + test_param;

0 commit comments

Comments
 (0)