4
4
#ifndef FIXTURE_BENCH_HPP
5
5
#define FIXTURE_BENCH_HPP
6
6
7
-
8
7
#include < benchmark/benchmark.h>
9
8
10
9
namespace example_namespace {
11
10
12
11
class MyFixture : public benchmark ::Fixture {
13
- public:
14
- void SetUp (::benchmark::State &state) {}
12
+ public:
13
+ void SetUp (::benchmark::State &state) { ( void )state; }
15
14
16
- void TearDown (::benchmark::State &state) {}
15
+ void TearDown (::benchmark::State &state) { ( void )state; }
17
16
};
18
17
BENCHMARK_F (MyFixture, FooTest)(benchmark::State &st) {
19
18
for (auto _ : st) {
@@ -28,7 +27,8 @@ BENCHMARK_REGISTER_F(MyFixture, BarTest);
28
27
//
29
28
//
30
29
31
- template <typename T> class MyTemplatedFixture : public benchmark ::Fixture {};
30
+ template <typename T>
31
+ class MyTemplatedFixture : public benchmark ::Fixture {};
32
32
BENCHMARK_TEMPLATE_F (MyTemplatedFixture, IntTest, int )(benchmark::State &st) {
33
33
for (auto _ : st) {
34
34
}
@@ -43,7 +43,8 @@ BENCHMARK_REGISTER_F(MyTemplatedFixture, DoubleTest);
43
43
//
44
44
//
45
45
46
- template <typename T> class MyTemplate1 : public benchmark ::Fixture {};
46
+ template <typename T>
47
+ class MyTemplate1 : public benchmark ::Fixture {};
47
48
BENCHMARK_TEMPLATE1_DEFINE_F (MyTemplate1, TestA, int )(benchmark::State &st) {
48
49
for (auto _ : st) {
49
50
}
@@ -53,13 +54,15 @@ BENCHMARK_REGISTER_F(MyTemplate1, TestA);
53
54
//
54
55
//
55
56
56
- template <typename T, typename U> class MyTemplate2 : public benchmark ::Fixture {};
57
- BENCHMARK_TEMPLATE2_DEFINE_F (MyTemplate2, TestB, int , double )(benchmark::State &st) {
57
+ template <typename T, typename U>
58
+ class MyTemplate2 : public benchmark ::Fixture {};
59
+ BENCHMARK_TEMPLATE2_DEFINE_F (MyTemplate2, TestB, int ,
60
+ double )(benchmark::State &st) {
58
61
for (auto _ : st) {
59
62
}
60
63
}
61
64
BENCHMARK_REGISTER_F (MyTemplate2, TestB);
62
65
63
- }
66
+ } // namespace example_namespace
64
67
65
68
#endif
0 commit comments