blob: 839bf46074ff70eddfb1645640963d9ad6438201 [file] [log] [blame]
Shawn McCarney76c14c32020-07-15 10:10:20 -05001/**
2 * Copyright © 2020 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include "error_logging.hpp"
Shawn McCarney5dab5d32021-08-28 11:02:14 -050019#include "phase_fault.hpp"
Shawn McCarney76c14c32020-07-15 10:10:20 -050020
21#include <gmock/gmock.h>
22
23namespace phosphor::power::regulators
24{
25
26/**
27 * @class MockErrorLogging
28 *
29 * Mock implementation of the ErrorLogging interface.
30 */
31class MockErrorLogging : public ErrorLogging
32{
33 public:
34 // Specify which compiler-generated methods we want
35 MockErrorLogging() = default;
36 MockErrorLogging(const MockErrorLogging&) = delete;
37 MockErrorLogging(MockErrorLogging&&) = delete;
38 MockErrorLogging& operator=(const MockErrorLogging&) = delete;
39 MockErrorLogging& operator=(MockErrorLogging&&) = delete;
40 virtual ~MockErrorLogging() = default;
41
Shawn McCarney1df59542020-09-24 18:43:18 -050042 MOCK_METHOD(void, logConfigFileError,
43 (Entry::Level severity, Journal& journal), (override));
44
45 MOCK_METHOD(void, logDBusError, (Entry::Level severity, Journal& journal),
46 (override));
47
48 MOCK_METHOD(void, logI2CError,
49 (Entry::Level severity, Journal& journal,
50 const std::string& bus, uint8_t addr, int errorNumber),
51 (override));
52
53 MOCK_METHOD(void, logInternalError,
54 (Entry::Level severity, Journal& journal), (override));
55
Shawn McCarney5dab5d32021-08-28 11:02:14 -050056 MOCK_METHOD(void, logPhaseFault,
57 (Entry::Level severity, Journal& journal, PhaseFaultType type,
58 const std::string& inventoryPath,
59 (std::map<std::string, std::string> additionalData)),
60 (override));
61
Shawn McCarney1df59542020-09-24 18:43:18 -050062 MOCK_METHOD(void, logPMBusError,
63 (Entry::Level severity, Journal& journal,
64 const std::string& inventoryPath),
65 (override));
66
67 MOCK_METHOD(void, logWriteVerificationError,
68 (Entry::Level severity, Journal& journal,
69 const std::string& inventoryPath),
70 (override));
Shawn McCarney76c14c32020-07-15 10:10:20 -050071};
72
73} // namespace phosphor::power::regulators