diff --git a/test/complexity_test.cc b/test/complexity_test.cc index a74008db..7a048914 100644 --- a/test/complexity_test.cc +++ b/test/complexity_test.cc @@ -16,7 +16,7 @@ int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name, std::string big_o) { SetSubstitutions({{"%bigo_name", big_o_test_name}, {"%rms_name", rms_test_name}, - {"%bigo_str", "[ ]*" + std::string(dec_re) + " " + big_o}, + {"%bigo_str", "[ ]* %float " + big_o}, {"%bigo", big_o}, {"%rms", "[ ]*[0-9]+ %"}}); AddCases( diff --git a/test/output_test_helper.cc b/test/output_test_helper.cc index 2f48b414..bbcc8a83 100644 --- a/test/output_test_helper.cc +++ b/test/output_test_helper.cc @@ -160,16 +160,17 @@ int AddCases(TestCaseID ID, std::initializer_list il) { int SetSubstitutions( std::initializer_list> il) { auto& subs = internal::GetSubstitutions(); - for (auto const& KV : il) { + for (auto KV : il) { bool exists = false; + KV.second = internal::PerformSubstitutions(KV.second); for (auto& EKV : subs) { if (EKV.first == KV.first) { - EKV.second = KV.second; + EKV.second = std::move(KV.second); exists = true; break; } } - if (!exists) subs.push_back(KV); + if (!exists) subs.push_back(std::move(KV)); } return 0; } diff --git a/test/reporter_output_test.cc b/test/reporter_output_test.cc index 7e314221..579135d0 100644 --- a/test/reporter_output_test.cc +++ b/test/reporter_output_test.cc @@ -61,7 +61,7 @@ void BM_Complexity_O1(benchmark::State& state) { state.SetComplexityN(state.range(0)); } BENCHMARK(BM_Complexity_O1)->Range(1, 1 << 18)->Complexity(benchmark::o1); -SET_SUBSTITUTIONS({{"%bigOStr", "[ ]*[0-9]+\\.[0-9]+ \\([0-9]+\\)"}, +SET_SUBSTITUTIONS({{"%bigOStr", "[ ]* %float \\([0-9]+\\)"}, {"%RMS", "[ ]*[0-9]+ %"}}); ADD_CASES(TC_ConsoleOut, {{"^BM_Complexity_O1_BigO %bigOStr %bigOStr[ ]*$"}, {"^BM_Complexity_O1_RMS %RMS %RMS[ ]*$"}});