xref: /openbmc/telemetry/tests/src/helpers/interfaces/sensor_id_helpers.hpp (revision 405c1e4bf8b993cb3800adead546e91b030ecb9b)
1 #pragma once
2 
3 #include "interfaces/sensor.hpp"
4 
5 #include <gmock/gmock.h>
6 
7 namespace interfaces
8 {
9 
10 inline void PrintTo(const Sensor::Id& o, std::ostream* os)
11 {
12     (*os) << "{ type: " << o.type << ", service: " << o.service
13           << ", path: " << o.path << " }";
14 }
15 
16 inline bool operator==(const Sensor::Id& left, const Sensor::Id& right)
17 {
18     return std::tie(left.type, left.service, left.path) ==
19            std::tie(right.type, right.service, right.path);
20 }
21 
22 } // namespace interfaces