aboutsummaryrefslogtreecommitdiff
path: root/src/console_reporter.cc
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-05-24 16:19:04 -0600
committerEric Fiselier <eric@efcs.ca>2016-05-24 16:19:04 -0600
commitee8e37c67db9a717059f9f7bdfb83549208d65e9 (patch)
tree9dba3e67ab123a15549be8dea2b83a9bd254fdb7 /src/console_reporter.cc
parent6a45324e1d1c1f2c7e56a2df970e38a62122fc4f (diff)
downloadgoogle-benchmark-ee8e37c67db9a717059f9f7bdfb83549208d65e9.tar.gz
Fix bad merge which caused the benchmark name to be printed twice
Diffstat (limited to 'src/console_reporter.cc')
-rw-r--r--src/console_reporter.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/console_reporter.cc b/src/console_reporter.cc
index 2b1f281..3944666 100644
--- a/src/console_reporter.cc
+++ b/src/console_reporter.cc
@@ -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 ",