Michal Orzel | b3e03d2 | 2024-06-28 13:55:47 +0200 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "types/readings.hpp" |
| 4 | #include "types/report_action.hpp" |
| 5 | |
| 6 | #include <ostream> |
| 7 | |
| 8 | #include <gmock/gmock.h> |
| 9 | |
| 10 | template <class Param> |
| 11 | void PrintTo(const std::vector<Param>& vec, std::ostream* os); |
| 12 | |
| 13 | inline void PrintTo(const ReadingData& data, std::ostream* os) |
| 14 | { |
| 15 | const auto& [id, value, timestamp] = data; |
| 16 | *os << "( " << id << ", " << std::to_string(value) << ", " |
| 17 | << std::to_string(timestamp) << " )"; |
| 18 | } |
| 19 | |
| 20 | inline void PrintTo(const Readings& readings, std::ostream* os) |
| 21 | { |
| 22 | const auto& [timestamp, readingDataVec] = readings; |
| 23 | *os << "( " << std::to_string(timestamp) << ", "; |
| 24 | PrintTo(readingDataVec, os); |
| 25 | *os << " )"; |
| 26 | } |
| 27 | |
| 28 | inline void PrintTo(const ReportAction& action, std::ostream* os) |
| 29 | { |
| 30 | *os << utils::enumToString(action); |
| 31 | } |