xref: /openbmc/telemetry/tests/src/helpers/metric_value_helpers.hpp (revision 53fb785568946ef22dd79dde100bb6d77a58f080)
1 #pragma once
2 
3 #include "metric_value.hpp"
4 
5 #include <gmock/gmock.h>
6 
7 inline void PrintTo(const MetricValue& o, std::ostream* os)
8 {
9     (*os) << "{ metadata: " << o.metadata << ", value: " << o.value
10           << ", timestamp: " << o.timestamp << " }";
11 }
12 
13 inline bool operator==(const MetricValue& left, const MetricValue& right)
14 {
15     return std::tie(left.metadata, left.value, left.timestamp) ==
16            std::tie(right.metadata, right.value, right.timestamp);
17 }
18