1
0
mirror of https://github.com/google/benchmark.git synced 2025-03-27 04:27:12 +08:00

Fix bad merge which caused the benchmark name to be printed twice

This commit is contained in:
Eric Fiselier 2016-05-24 16:19:04 -06:00
parent 6a45324e1d
commit ee8e37c67d

View File

@ -100,11 +100,14 @@ void ConsoleReporter::ReportComplexity(const std::vector<Run> & complexity_repor
}
void ConsoleReporter::PrintRunData(const Run& result) {
ColorPrintf(COLOR_GREEN, "%-*s ",
name_field_width_, result.benchmark_name.c_str());
auto name_color = (result.report_big_o || result.report_rms)
? COLOR_BLUE : COLOR_GREEN;
ColorPrintf(name_color, "%-*s ", name_field_width_,
result.benchmark_name.c_str());
if (result.error_occurred) {
ColorPrintf(COLOR_RED, "ERROR OCCURRED: \'%s\'", result.error_message.c_str());
ColorPrintf(COLOR_RED, "ERROR OCCURRED: \'%s\'",
result.error_message.c_str());
ColorPrintf(COLOR_DEFAULT, "\n");
return;
}
@ -125,10 +128,6 @@ void ConsoleReporter::PrintRunData(const Run& result) {
const char* timeLabel;
std::tie(timeLabel, multiplier) = GetTimeUnitAndMultiplier(result.time_unit);
ColorPrintf((result.report_big_o ||result.report_rms) ? COLOR_BLUE :
COLOR_GREEN, "%-*s ",
name_field_width_, result.benchmark_name.c_str());
if(result.report_big_o) {
std::string big_o = result.report_big_o ? GetBigO(result.complexity) : "";
ColorPrintf(COLOR_YELLOW, "%10.4f %s %10.4f %s ",