Patrick Venture | a58197c | 2018-06-11 15:29:45 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 1a15379 | 2020-08-11 08:41:47 -0700 | [diff] [blame] | 3 | #include "pid/zone_interface.hpp" |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 4 | |
Patrick Venture | a58197c | 2018-06-11 15:29:45 -0700 | [diff] [blame] | 5 | #include <string> |
| 6 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 7 | #include <gmock/gmock.h> |
Patrick Venture | a58197c | 2018-06-11 15:29:45 -0700 | [diff] [blame] | 8 | |
Patrick Venture | a076487 | 2020-08-08 07:48:43 -0700 | [diff] [blame] | 9 | namespace pid_control |
| 10 | { |
| 11 | |
Patrick Venture | a58197c | 2018-06-11 15:29:45 -0700 | [diff] [blame] | 12 | class ZoneMock : public ZoneInterface |
| 13 | { |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 14 | public: |
| 15 | virtual ~ZoneMock() = default; |
Patrick Venture | a58197c | 2018-06-11 15:29:45 -0700 | [diff] [blame] | 16 | |
Patrick Venture | 7a98c19 | 2020-08-12 08:35:16 -0700 | [diff] [blame] | 17 | MOCK_METHOD0(updateFanTelemetry, void()); |
| 18 | MOCK_METHOD0(updateSensors, void()); |
| 19 | MOCK_METHOD0(initializeCache, void()); |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 20 | MOCK_METHOD1(getCachedValue, double(const std::string&)); |
Josh Lehan | d38ae27 | 2020-11-13 02:59:30 -0800 | [diff] [blame] | 21 | |
| 22 | // Compatibility interface for getCachedValues |
| 23 | ValueCacheEntry getCachedValues(const std::string& s) |
| 24 | { |
| 25 | auto v = getCachedValue(s); |
Josh Lehan | 3f0f7bc | 2023-02-13 01:45:29 -0800 | [diff] [blame] | 26 | return {v, v}; |
Josh Lehan | d38ae27 | 2020-11-13 02:59:30 -0800 | [diff] [blame] | 27 | } |
| 28 | |
Josh Lehan | a4146eb | 2020-10-01 11:49:09 -0700 | [diff] [blame] | 29 | MOCK_CONST_METHOD0(getRedundantWrite, bool(void)); |
Nirav Shah | ccc8bb6 | 2022-02-17 21:06:51 -0800 | [diff] [blame] | 30 | MOCK_METHOD2(addSetPoint, void(double, const std::string&)); |
Josh Lehan | b300575 | 2022-02-22 20:48:07 -0800 | [diff] [blame] | 31 | MOCK_METHOD2(setOutputCache, |
| 32 | void(std::string_view name, const ValueCacheEntry& values)); |
Patrick Venture | 7a98c19 | 2020-08-12 08:35:16 -0700 | [diff] [blame] | 33 | MOCK_METHOD0(clearSetPoints, void()); |
James Feist | 608304d | 2019-02-25 10:01:42 -0800 | [diff] [blame] | 34 | MOCK_METHOD1(addRPMCeiling, void(double)); |
Patrick Venture | 7a98c19 | 2020-08-12 08:35:16 -0700 | [diff] [blame] | 35 | MOCK_METHOD0(clearRPMCeilings, void()); |
| 36 | MOCK_METHOD0(determineMaxSetPointRequest, void()); |
Patrick Venture | f7a2dd5 | 2019-07-16 14:31:13 -0700 | [diff] [blame] | 37 | MOCK_CONST_METHOD0(getMaxSetPointRequest, double()); |
Patrick Venture | 7a98c19 | 2020-08-12 08:35:16 -0700 | [diff] [blame] | 38 | |
| 39 | MOCK_METHOD0(processFans, void()); |
| 40 | MOCK_METHOD0(processThermals, void()); |
| 41 | |
| 42 | MOCK_CONST_METHOD0(getManualMode, bool()); |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 43 | MOCK_CONST_METHOD0(getFailSafeMode, bool()); |
Patrick Venture | 5f59c0f | 2018-11-11 12:55:14 -0800 | [diff] [blame] | 44 | MOCK_CONST_METHOD0(getFailSafePercent, double()); |
Bonnie Lo | c51ba91 | 2022-10-12 14:07:22 +0800 | [diff] [blame] | 45 | MOCK_CONST_METHOD0(getZoneID, int64_t()); |
Patrick Venture | 7a98c19 | 2020-08-12 08:35:16 -0700 | [diff] [blame] | 46 | |
Bonnie Lo | 0e8fc39 | 2022-10-05 10:20:55 +0800 | [diff] [blame] | 47 | MOCK_CONST_METHOD0(getCycleIntervalTime, uint64_t()); |
| 48 | MOCK_CONST_METHOD0(getUpdateThermalsCycle, uint64_t()); |
| 49 | |
Patrick Venture | 2d8e785 | 2018-10-30 19:14:07 -0700 | [diff] [blame] | 50 | MOCK_METHOD1(getSensor, Sensor*(const std::string&)); |
Patrick Venture | 7a98c19 | 2020-08-12 08:35:16 -0700 | [diff] [blame] | 51 | |
| 52 | MOCK_METHOD0(initializeLog, void()); |
| 53 | MOCK_METHOD1(writeLog, void(const std::string&)); |
Harvey Wu | 3718006 | 2023-10-02 09:42:50 +0800 | [diff] [blame] | 54 | |
| 55 | MOCK_METHOD4(updateThermalPowerDebugInterface, |
| 56 | void(std::string pidName, std::string leader, double input, |
| 57 | double output)); |
Patrick Venture | a58197c | 2018-06-11 15:29:45 -0700 | [diff] [blame] | 58 | }; |
Patrick Venture | a076487 | 2020-08-08 07:48:43 -0700 | [diff] [blame] | 59 | |
| 60 | } // namespace pid_control |