All checks were successful
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 1m7s
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m15s
sm-rpc / build (Debug, host.gcc) (push) Successful in 1m4s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 1m16s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 1m34s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 1m33s
sm-rpc / build (Release, host.gcc) (push) Successful in 1m23s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 1m30s
38 lines
872 B
C++
38 lines
872 B
C++
#include "../include/benchmark/benchmark.h"
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace benchmark {
|
|
namespace internal {
|
|
|
|
namespace {
|
|
|
|
class DummyBenchmark : public Benchmark {
|
|
public:
|
|
DummyBenchmark() : Benchmark("dummy") {}
|
|
void Run(State&) override {}
|
|
};
|
|
|
|
TEST(DefaultTimeUnitTest, TimeUnitIsNotSet) {
|
|
DummyBenchmark benchmark;
|
|
EXPECT_EQ(benchmark.GetTimeUnit(), kNanosecond);
|
|
}
|
|
|
|
TEST(DefaultTimeUnitTest, DefaultIsSet) {
|
|
DummyBenchmark benchmark;
|
|
EXPECT_EQ(benchmark.GetTimeUnit(), kNanosecond);
|
|
SetDefaultTimeUnit(kMillisecond);
|
|
EXPECT_EQ(benchmark.GetTimeUnit(), kMillisecond);
|
|
}
|
|
|
|
TEST(DefaultTimeUnitTest, DefaultAndExplicitUnitIsSet) {
|
|
DummyBenchmark benchmark;
|
|
benchmark.Unit(kMillisecond);
|
|
SetDefaultTimeUnit(kMicrosecond);
|
|
|
|
EXPECT_EQ(benchmark.GetTimeUnit(), kMillisecond);
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace internal
|
|
} // namespace benchmark
|