summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grandi <agrandi@google.com>2022-11-28 11:59:29 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-29 17:34:29 +0000
commitf8ac295d745a9316f087a3b8a991e80d10103764 (patch)
tree36153b03580ca89668d0d9da096df2a5b06365f9
parent234a87ae2d1f564c98df2f70f00b2b226528feaf (diff)
downloadchrome-ec-f8ac295d745a9316f087a3b8a991e80d10103764.tar.gz
test: Add const to functions of benchmark.h
BUG=b:246366702 BRANCH=none TEST=test/run_device_tests.py -b bloonchipper -t benchmark TEST=make run-benchmark Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I73bacbd76194055d79ca3a250a4fab6d0c67ff4d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4062574 Reviewed-by: Bobby Casey <bobbycasey@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--include/benchmark.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/benchmark.h b/include/benchmark.h
index f9c9a1afcd..d2fcc9388c 100644
--- a/include/benchmark.h
+++ b/include/benchmark.h
@@ -115,7 +115,7 @@ template <int MAX_NUM_RESULTS = 5> class Benchmark {
return result;
}
- void print_results()
+ void print_results() const
{
print_header();
for (int i = 0; i < num_results_; ++i)
@@ -128,7 +128,7 @@ template <int MAX_NUM_RESULTS = 5> class Benchmark {
int num_results_ = 0;
/* Print table header with column names */
- void print_header()
+ void print_header() const
{
constexpr char kSeparator[] = "--------------------------";
@@ -142,7 +142,7 @@ template <int MAX_NUM_RESULTS = 5> class Benchmark {
}
/* Print a single benchmark result */
- int print_result(const BenchmarkResult &result)
+ int print_result(const BenchmarkResult &result) const
{
ccprintf("%16s | %15u | %13u | %13u | %13u | %13u\n",
result.name.data(), options_.num_iterations,