From 40df1e9b770393a77afc2ebb94ff7e8f6f8696ed Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Tue, 6 Feb 2018 16:53:47 +0000 Subject: COMPMID-887 Valgrind invalid read in print_measurements Change-Id: I595d9ac7a616b3ab21ccc889251d0895c9ac9fb0 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/119099 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- tests/framework/instruments/Measurement.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/framework/instruments/Measurement.h') diff --git a/tests/framework/instruments/Measurement.h b/tests/framework/instruments/Measurement.h index 9fb75d7b99..1beacf6cc5 100644 --- a/tests/framework/instruments/Measurement.h +++ b/tests/framework/instruments/Measurement.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -208,6 +208,17 @@ struct Measurement bool is_floating_point; /**< Is the stored value floating point or integer ? */ }; + /** Compare the stored value with another value + * + * @param[in] b Value to compare against + * + * @return The result of stored value < b + */ + bool operator<(const Measurement &b) const + { + return _value < b.value(); + } + /** Stream output operator to print the measurement. * * Prints value and unit. -- cgit v1.2.1