mirror of https://github.com/google/benchmark.git
remove ifdefs around BM_Factorial
This commit is contained in:
parent
8f96f50553
commit
f947cebe15
|
@ -32,7 +32,7 @@ endmacro(add_gtest_test)
|
|||
|
||||
# Demonstration executable
|
||||
compile_benchmark_test(benchmark_test)
|
||||
add_test(benchmark benchmark_test --benchmark_min_time=0.1 50)
|
||||
add_test(benchmark benchmark_test --benchmark_min_time=0.1 51)
|
||||
add_test(benchmark_filter_simple benchmark_test --benchmark_filter=Calculate 16)
|
||||
add_test(benchmark_filter_suffix benchmark_test --benchmark_filter=Calculate* 16)
|
||||
add_test(benchmark_filter_regex_wildcard benchmark_test --benchmark_filter=.*Calculate.* 16)
|
||||
|
|
|
@ -24,11 +24,9 @@
|
|||
|
||||
namespace {
|
||||
|
||||
#if 0 // TODO(ericwf): Remove this or figure out its purpose.
|
||||
int BENCHMARK_NOINLINE Factorial(uint32_t n) {
|
||||
return (n == 1) ? 1 : n * Factorial(n - 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
double CalculatePi(int depth) {
|
||||
double pi = 0.0;
|
||||
|
@ -52,7 +50,6 @@ std::vector<int>* test_vector = nullptr;
|
|||
|
||||
} // end namespace
|
||||
|
||||
#if 0 // TODO(ericwf): Remove this or figure out its purpose.
|
||||
static void BM_Factorial(benchmark::State& state) {
|
||||
int fac_42 = 0;
|
||||
while (state.KeepRunning())
|
||||
|
@ -61,7 +58,6 @@ static void BM_Factorial(benchmark::State& state) {
|
|||
EXPECT_NE(fac_42, std::numeric_limits<int>::max());
|
||||
}
|
||||
BENCHMARK(BM_Factorial);
|
||||
#endif
|
||||
|
||||
static void BM_CalculatePiRange(benchmark::State& state) {
|
||||
double pi = 0.0;
|
||||
|
@ -179,9 +175,7 @@ class TestReporter : public benchmark::internal::ConsoleReporter {
|
|||
int main(int argc, const char* argv[]) {
|
||||
benchmark::Initialize(&argc, argv);
|
||||
|
||||
#if 0 // TODO(ericwf): Remove this or figure out its purpose.
|
||||
assert(Factorial(8) == 40320);
|
||||
#endif
|
||||
assert(CalculatePi(1) == 0.0);
|
||||
|
||||
TestReporter test_reporter;
|
||||
|
|
Loading…
Reference in New Issue