blob: a3d6be9b4dd0af3235d6f882e0302b467a0772ad [file] [log] [blame]
Patrick Venturea58197c2018-06-11 15:29:45 -07001#pragma once
2
Patrick Venture1a153792020-08-11 08:41:47 -07003#include "pid/zone_interface.hpp"
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07004
Patrick Venturea58197c2018-06-11 15:29:45 -07005#include <string>
6
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07007#include <gmock/gmock.h>
Patrick Venturea58197c2018-06-11 15:29:45 -07008
Patrick Venturea0764872020-08-08 07:48:43 -07009namespace pid_control
10{
11
Patrick Venturea58197c2018-06-11 15:29:45 -070012class ZoneMock : public ZoneInterface
13{
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070014 public:
15 virtual ~ZoneMock() = default;
Patrick Venturea58197c2018-06-11 15:29:45 -070016
Patrick Venture7a98c192020-08-12 08:35:16 -070017 MOCK_METHOD0(updateFanTelemetry, void());
18 MOCK_METHOD0(updateSensors, void());
19 MOCK_METHOD0(initializeCache, void());
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070020 MOCK_METHOD1(getCachedValue, double(const std::string&));
Josh Lehand38ae272020-11-13 02:59:30 -080021
22 // Compatibility interface for getCachedValues
23 ValueCacheEntry getCachedValues(const std::string& s)
24 {
25 auto v = getCachedValue(s);
Josh Lehan3f0f7bc2023-02-13 01:45:29 -080026 return {v, v};
Josh Lehand38ae272020-11-13 02:59:30 -080027 }
28
Josh Lehana4146eb2020-10-01 11:49:09 -070029 MOCK_CONST_METHOD0(getRedundantWrite, bool(void));
Nirav Shahccc8bb62022-02-17 21:06:51 -080030 MOCK_METHOD2(addSetPoint, void(double, const std::string&));
Josh Lehanb3005752022-02-22 20:48:07 -080031 MOCK_METHOD2(setOutputCache,
32 void(std::string_view name, const ValueCacheEntry& values));
Patrick Venture7a98c192020-08-12 08:35:16 -070033 MOCK_METHOD0(clearSetPoints, void());
James Feist608304d2019-02-25 10:01:42 -080034 MOCK_METHOD1(addRPMCeiling, void(double));
Patrick Venture7a98c192020-08-12 08:35:16 -070035 MOCK_METHOD0(clearRPMCeilings, void());
36 MOCK_METHOD0(determineMaxSetPointRequest, void());
Patrick Venturef7a2dd52019-07-16 14:31:13 -070037 MOCK_CONST_METHOD0(getMaxSetPointRequest, double());
Patrick Venture7a98c192020-08-12 08:35:16 -070038
39 MOCK_METHOD0(processFans, void());
40 MOCK_METHOD0(processThermals, void());
41
42 MOCK_CONST_METHOD0(getManualMode, bool());
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070043 MOCK_CONST_METHOD0(getFailSafeMode, bool());
Patrick Venture5f59c0f2018-11-11 12:55:14 -080044 MOCK_CONST_METHOD0(getFailSafePercent, double());
Bonnie Loc51ba912022-10-12 14:07:22 +080045 MOCK_CONST_METHOD0(getZoneID, int64_t());
Patrick Venture7a98c192020-08-12 08:35:16 -070046
Bonnie Lo0e8fc392022-10-05 10:20:55 +080047 MOCK_CONST_METHOD0(getCycleIntervalTime, uint64_t());
48 MOCK_CONST_METHOD0(getUpdateThermalsCycle, uint64_t());
49
Patrick Venture2d8e7852018-10-30 19:14:07 -070050 MOCK_METHOD1(getSensor, Sensor*(const std::string&));
Patrick Venture7a98c192020-08-12 08:35:16 -070051
52 MOCK_METHOD0(initializeLog, void());
53 MOCK_METHOD1(writeLog, void(const std::string&));
Harvey Wu37180062023-10-02 09:42:50 +080054
55 MOCK_METHOD4(updateThermalPowerDebugInterface,
56 void(std::string pidName, std::string leader, double input,
57 double output));
Patrick Venturea58197c2018-06-11 15:29:45 -070058};
Patrick Venturea0764872020-08-08 07:48:43 -070059
60} // namespace pid_control