aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/instruments/Measurement.h
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2018-02-06 16:53:47 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:46:07 +0000
commit40df1e9b770393a77afc2ebb94ff7e8f6f8696ed (patch)
treeef492bb1cd0a14e7cf3315da01e62b2973828b8d /tests/framework/instruments/Measurement.h
parentf75ab3fb8a1a2a617499c41f8d06e63174165012 (diff)
downloadComputeLibrary-40df1e9b770393a77afc2ebb94ff7e8f6f8696ed.tar.gz
COMPMID-887 Valgrind invalid read in print_measurements
Change-Id: I595d9ac7a616b3ab21ccc889251d0895c9ac9fb0 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/119099 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/framework/instruments/Measurement.h')
-rw-r--r--tests/framework/instruments/Measurement.h13
1 files changed, 12 insertions, 1 deletions
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.