Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
dmah42 committed Jan 13, 2025
1 parent d9f79cd commit 65b933d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
35 changes: 16 additions & 19 deletions include/benchmark/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ inline BENCHMARK_ALWAYS_INLINE
}
#endif


#elif defined(_MSC_VER)
template <class Tp>
BENCHMARK_DEPRECATED_MSG(
Expand Down Expand Up @@ -630,7 +629,7 @@ class Counter {
Counter(double v = 0., Flags f = kDefaults, OneK k = kIs1000)
: value(v), flags(f), oneK(k) {}

BENCHMARK_ALWAYS_INLINE operator double const &() const { return value; }
BENCHMARK_ALWAYS_INLINE operator double const&() const { return value; }
BENCHMARK_ALWAYS_INLINE operator double&() { return value; }
};

Expand Down Expand Up @@ -681,8 +680,7 @@ class ThreadTimer;
class ThreadManager;
class PerfCountersMeasurement;

enum AggregationReportMode : unsigned
{
enum AggregationReportMode : unsigned {
// The mode has not been manually specified
ARM_Unspecified = 0,
// The mode is user-specified.
Expand All @@ -697,8 +695,7 @@ enum AggregationReportMode : unsigned
ARM_FileReportAggregatesOnly | ARM_DisplayReportAggregatesOnly
};

enum Skipped : unsigned
{
enum Skipped : unsigned {
NotSkipped = 0,
SkippedWithMessage,
SkippedWithError
Expand Down Expand Up @@ -1019,7 +1016,7 @@ inline BENCHMARK_ALWAYS_INLINE bool State::KeepRunningInternal(IterationCount n,
}

struct State::StateIterator {
struct BENCHMARK_UNUSED Value {};
struct BENCHMARK_UNUSED Value{};
typedef std::forward_iterator_tag iterator_category;
typedef Value value_type;
typedef Value reference;
Expand Down Expand Up @@ -1526,15 +1523,15 @@ class Fixture : public internal::Benchmark {
"/" #test_case_name, \
[](::benchmark::State& st) { func<a, b>(st, __VA_ARGS__); })))

#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
class BaseClass##_##Method##_Benchmark : public BaseClass { \
public: \
BaseClass##_##Method##_Benchmark() { \
this->SetName(#BaseClass "/" #Method); \
} \
\
protected: \
void BenchmarkCase(::benchmark::State&) override; \
#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
class BaseClass##_##Method##_Benchmark : public BaseClass { \
public: \
BaseClass##_##Method##_Benchmark() { \
this->SetName(#BaseClass "/" #Method); \
} \
\
protected: \
void BenchmarkCase(::benchmark::State&) override; \
};

#define BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
Expand All @@ -1545,7 +1542,7 @@ class Fixture : public internal::Benchmark {
} \
\
protected: \
void BenchmarkCase(::benchmark::State&) override; \
void BenchmarkCase(::benchmark::State&) override; \
};

#define BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
Expand All @@ -1556,7 +1553,7 @@ class Fixture : public internal::Benchmark {
} \
\
protected: \
void BenchmarkCase(::benchmark::State&) override; \
void BenchmarkCase(::benchmark::State&) override; \
};

#define BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, ...) \
Expand All @@ -1567,7 +1564,7 @@ class Fixture : public internal::Benchmark {
} \
\
protected: \
void BenchmarkCase(::benchmark::State&) override; \
void BenchmarkCase(::benchmark::State&) override; \
};

#define BENCHMARK_DEFINE_F(BaseClass, Method) \
Expand Down
14 changes: 7 additions & 7 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TEST_COPTS = [
"-Wconversion",
"-Wextra",
"-Wshadow",
# "-Wshorten-64-to-32",
#"-Wshorten-64-to-32",
"-Wfloat-equal",
"-fstrict-aliasing",
## assert() are used a lot in tests upstream, which may be optimised out leading to
Expand All @@ -24,7 +24,7 @@ TEST_COPTS = [
"-Werror=old-style-cast",
]

# Some of the issues with DoNotOptimize only occur when optimization is enabled
#Some of the issues with DoNotOptimize only occur when optimization is enabled
PER_SRC_COPTS = {
"donotoptimize_test.cc": ["-O3"],
}
Expand Down Expand Up @@ -54,7 +54,7 @@ cc_library(
],
)

# Tests that use gtest. These rely on `gtest_main`.
#Tests that use gtest.These rely on `gtest_main`.
[
cc_test(
name = test_src[:-len(".cc")],
Expand All @@ -74,7 +74,7 @@ cc_library(
for test_src in glob(["*_gtest.cc"])
]

# Tests that do not use gtest. These have their own `main` defined.
#Tests that do not use gtest.These have their own `main` defined.
[
cc_test(
name = test_src[:-len(".cc")],
Expand All @@ -90,9 +90,9 @@ cc_library(
"//:benchmark",
"//:benchmark_internal_headers",
],
# FIXME: Add support for assembly tests to bazel.
# See Issue #556
# https://github.com/google/benchmark/issues/556
#FIXME : Add support for assembly tests to bazel.
#See Issue #556
#https: // github.com/google/benchmark/issues/556
)
for test_src in glob(
["*_test.cc"],
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Enable the tests
#Enable the tests

set(THREADS_PREFER_PTHREAD_FLAG ON)

Expand Down

0 comments on commit 65b933d

Please sign in to comment.