xref: /openbmc/telemetry/tests/src/helpers/metric_value_helpers.hpp (revision cff70c14ef8cadb7fffd0cd41e06b972fa240e56)
1 #pragma once
2 
3 #include "metric_value.hpp"
4 
5 #include <gmock/gmock.h>
6 
PrintTo(const MetricValue & o,std::ostream * os)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 
operator ==(const MetricValue & left,const MetricValue & right)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