1
1
#include < gtest/gtest.h>
2
2
3
3
#include < chrono>
4
- #include < cstdint>
5
4
#include < filesystem>
6
5
#include < fstream>
7
6
#include < memory>
8
7
#include < ostream>
9
8
#include < stdexcept>
10
- #include < string_view >
9
+ #include < string >
11
10
#include < thread>
12
11
#include < vector>
13
12
@@ -56,6 +55,8 @@ class FakePerfTask : public TestPerfTask<InType, OutType> {
56
55
57
56
namespace ppc ::performance {
58
57
58
+ namespace {
59
+
59
60
TEST (perf_tests, check_perf_pipeline) {
60
61
std::vector<uint32_t > in (2000 , 1 );
61
62
@@ -136,7 +137,7 @@ TEST(perf_tests, check_perf_task_float) {
136
137
}
137
138
138
139
struct ParamTestCase {
139
- PerfResults::TypeOfRunning input;
140
+ PerfResults::TypeOfRunning input{} ;
140
141
std::string expected_output;
141
142
friend void PrintTo (const ParamTestCase& param, std::ostream* os) {
142
143
*os << " { input = " << static_cast <int >(param.input ) << " , expected = " << param.expected_output << " }" ;
@@ -159,7 +160,7 @@ INSTANTIATE_TEST_SUITE_P(ParamTests, GetStringParamNameParamTest,
159
160
});
160
161
161
162
struct TaskTypeTestCase {
162
- TypeOfTask type;
163
+ TypeOfTask type{} ;
163
164
std::string expected;
164
165
std::string label;
165
166
friend void PrintTo (const TaskTypeTestCase& param, std::ostream* os) {
@@ -441,7 +442,7 @@ TEST(PerfTest, CommonRunCalculatesAverageTime) {
441
442
perf.PipelineRun (attr);
442
443
auto results = perf.GetPerfResults ();
443
444
444
- // Total time should be 3 seconds, average should be 1 second (3.0 - 0.0) / 3
445
+ // Total time should be 3 seconds, average should be 1 second (3.0- 0.0) / 3
445
446
EXPECT_DOUBLE_EQ (results.time_sec , 1.0 );
446
447
}
447
448
@@ -573,11 +574,10 @@ TEST(PerfTest, TaskRunCompletesPipelineAfterTiming) {
573
574
}
574
575
575
576
namespace test_namespace {
576
- struct TestType {};
577
577
} // namespace test_namespace
578
578
579
579
TEST (PerfTest, TemplateInstantiationWithDifferentTypes) {
580
- // Test that Perf template can be instantiated with different types
580
+ // Test that the Perf template can be instantiated with different types
581
581
auto int_task = std::make_shared<DummyTask>();
582
582
Perf<int , int > int_perf (int_task);
583
583
@@ -616,4 +616,6 @@ TEST(TaskTest, Destructor_InvalidPipelineOrderTerminates_PartialPipeline) {
616
616
ppc::util::DestructorFailureFlag::Unset ();
617
617
}
618
618
619
+ } // namespace
620
+
619
621
} // namespace ppc::performance
0 commit comments