From 950c8b74403f6f0ad962cac63efe1ccb18100692 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 22 Jul 2016 17:31:05 -0600 Subject: [PATCH] Fix suprious failures in complexity_test.cc --- test/complexity_test.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/complexity_test.cc b/test/complexity_test.cc index 6051f840..a2ba091f 100644 --- a/test/complexity_test.cc +++ b/test/complexity_test.cc @@ -121,7 +121,7 @@ std::string join(First f, Args&&... args) { return std::string(std::move(f)) + "[ ]+" + join(std::forward(args)...); } -std::string dec_re = "[0-9]+\\.[0-9]+"; +std::string dec_re = "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?"; #define ADD_COMPLEXITY_CASES(...) \ int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__) @@ -147,7 +147,7 @@ int AddComplexityTest(std::vector* console_out, std::vector* }); AddCases(csv_out, { {"^\"" + big_o_test_name + "\",," + dec_re + "," + dec_re + "," + big_o + ",,,,,$"}, - {"^\"" + rms_test_name + "\",," + dec_re + "," + dec_re + ",,,,,,$"} + {"^\"" + rms_test_name + "\",," + dec_re + "," + dec_re + ",,,,,,$", MR_Next} }); return 0; } @@ -164,8 +164,8 @@ void BM_Complexity_O1(benchmark::State& state) { state.SetComplexityN(state.range_x()); } BENCHMARK(BM_Complexity_O1) -> Range(1, 1<<18) -> Complexity(benchmark::o1); -BENCHMARK(BM_Complexity_O1) -> Range(1, 1<<18) -> Complexity([](int){return 1.0; }); BENCHMARK(BM_Complexity_O1) -> Range(1, 1<<18) -> Complexity(); +BENCHMARK(BM_Complexity_O1) -> Range(1, 1<<18) -> Complexity([](int){return 1.0; }); const char* big_o_1_test_name = "BM_Complexity_O1_BigO"; const char* rms_o_1_test_name = "BM_Complexity_O1_RMS"; @@ -176,6 +176,10 @@ const char* lambda_big_o_1 = "f\\(N\\)"; ADD_COMPLEXITY_CASES(&ConsoleOutputTests, &JSONOutputTests, &CSVOutputTests, big_o_1_test_name, rms_o_1_test_name, enum_auto_big_o_1); +// Add auto enum tests +ADD_COMPLEXITY_CASES(&ConsoleOutputTests, &JSONOutputTests, &CSVOutputTests, + big_o_1_test_name, rms_o_1_test_name, enum_auto_big_o_1); + // Add lambda tests ADD_COMPLEXITY_CASES(&ConsoleOutputTests, &JSONOutputTests, &CSVOutputTests, big_o_1_test_name, rms_o_1_test_name, lambda_big_o_1);