blob: 7d3a199d087591a1839189ab5d9c99141eea05d4 [file] [log] [blame]
Patrick Venturea58197c2018-06-11 15:29:45 -07001#pragma once
2
Ed Tanousf8b6e552025-06-27 13:27:50 -07003#include "interfaces.hpp"
Patrick Venture1a153792020-08-11 08:41:47 -07004#include "pid/zone_interface.hpp"
Ed Tanousf8b6e552025-06-27 13:27:50 -07005#include "sensors/sensor.hpp"
Patrick Ventureda4a5dd2018-08-31 09:42:48 -07006
Ed Tanousf8b6e552025-06-27 13:27:50 -07007#include <cstdint>
8#include <map>
Patrick Venturea58197c2018-06-11 15:29:45 -07009#include <string>
Ed Tanousf8b6e552025-06-27 13:27:50 -070010#include <string_view>
11#include <utility>
James Zheng6df8bb52024-11-27 23:38:47 +000012#include <vector>
Patrick Venturea58197c2018-06-11 15:29:45 -070013
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070014#include <gmock/gmock.h>
Patrick Venturea58197c2018-06-11 15:29:45 -070015
Patrick Venturea0764872020-08-08 07:48:43 -070016namespace pid_control
17{
18
Patrick Venturea58197c2018-06-11 15:29:45 -070019class ZoneMock : public ZoneInterface
20{
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070021 public:
Ed Tanousd2768c52025-06-26 11:42:57 -070022 ~ZoneMock() override = default;
Patrick Venturea58197c2018-06-11 15:29:45 -070023
Patrick Venture7a98c192020-08-12 08:35:16 -070024 MOCK_METHOD0(updateFanTelemetry, void());
25 MOCK_METHOD0(updateSensors, void());
26 MOCK_METHOD0(initializeCache, void());
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070027 MOCK_METHOD1(getCachedValue, double(const std::string&));
Josh Lehand38ae272020-11-13 02:59:30 -080028
29 // Compatibility interface for getCachedValues
Ed Tanousd2768c52025-06-26 11:42:57 -070030 ValueCacheEntry getCachedValues(const std::string& s) override
Josh Lehand38ae272020-11-13 02:59:30 -080031 {
32 auto v = getCachedValue(s);
Josh Lehan3f0f7bc2023-02-13 01:45:29 -080033 return {v, v};
Josh Lehand38ae272020-11-13 02:59:30 -080034 }
35
Josh Lehana4146eb2020-10-01 11:49:09 -070036 MOCK_CONST_METHOD0(getRedundantWrite, bool(void));
Nirav Shahccc8bb62022-02-17 21:06:51 -080037 MOCK_METHOD2(addSetPoint, void(double, const std::string&));
Josh Lehanb3005752022-02-22 20:48:07 -080038 MOCK_METHOD2(setOutputCache,
39 void(std::string_view name, const ValueCacheEntry& values));
Patrick Venture7a98c192020-08-12 08:35:16 -070040 MOCK_METHOD0(clearSetPoints, void());
James Feist608304d2019-02-25 10:01:42 -080041 MOCK_METHOD1(addRPMCeiling, void(double));
Patrick Venture7a98c192020-08-12 08:35:16 -070042 MOCK_METHOD0(clearRPMCeilings, void());
43 MOCK_METHOD0(determineMaxSetPointRequest, void());
Patrick Venturef7a2dd52019-07-16 14:31:13 -070044 MOCK_CONST_METHOD0(getMaxSetPointRequest, double());
Patrick Venture7a98c192020-08-12 08:35:16 -070045
46 MOCK_METHOD0(processFans, void());
47 MOCK_METHOD0(processThermals, void());
48
49 MOCK_CONST_METHOD0(getManualMode, bool());
Patrick Ventureda4a5dd2018-08-31 09:42:48 -070050 MOCK_CONST_METHOD0(getFailSafeMode, bool());
Harvey Wu92f9f3c2023-11-07 09:23:35 +080051 MOCK_METHOD0(getFailSafePercent, double());
Harvey Wua4270072024-05-29 16:11:13 +080052 MOCK_CONST_METHOD0(
53 getFailSafeSensors,
54 std::map<std::string, std::pair<std::string, double>>(void));
Bonnie Loc51ba912022-10-12 14:07:22 +080055 MOCK_CONST_METHOD0(getZoneID, int64_t());
Patrick Venture7a98c192020-08-12 08:35:16 -070056
Bonnie Lo0e8fc392022-10-05 10:20:55 +080057 MOCK_CONST_METHOD0(getCycleIntervalTime, uint64_t());
58 MOCK_CONST_METHOD0(getUpdateThermalsCycle, uint64_t());
Delphine CC Chiu97889632023-11-06 11:32:46 +080059 MOCK_CONST_METHOD0(getAccSetPoint, bool());
Bonnie Lo0e8fc392022-10-05 10:20:55 +080060
Patrick Venture2d8e7852018-10-30 19:14:07 -070061 MOCK_METHOD1(getSensor, Sensor*(const std::string&));
James Zheng6df8bb52024-11-27 23:38:47 +000062 MOCK_METHOD0(getSensorNames, std::vector<std::string>());
Patrick Venture7a98c192020-08-12 08:35:16 -070063
64 MOCK_METHOD0(initializeLog, void());
65 MOCK_METHOD1(writeLog, void(const std::string&));
Harvey Wu37180062023-10-02 09:42:50 +080066
67 MOCK_METHOD4(updateThermalPowerDebugInterface,
68 void(std::string pidName, std::string leader, double input,
69 double output));
Patrick Venturea58197c2018-06-11 15:29:45 -070070};
Patrick Venturea0764872020-08-08 07:48:43 -070071
72} // namespace pid_control