Patrick Venture | ef3aead | 2018-09-12 08:53:29 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | cd8dab4 | 2019-01-15 19:57:38 -0800 | [diff] [blame^] | 3 | #include "manager.hpp" |
| 4 | |
Patrick Venture | aceb4ba | 2018-09-27 14:50:37 -0700 | [diff] [blame] | 5 | #include <blobs-ipmid/blobs.hpp> |
Patrick Venture | ef3aead | 2018-09-12 08:53:29 -0700 | [diff] [blame] | 6 | #include <memory> |
| 7 | #include <string> |
| 8 | |
| 9 | #include <gmock/gmock.h> |
| 10 | |
| 11 | namespace blobs |
| 12 | { |
| 13 | |
| 14 | class ManagerMock : public ManagerInterface |
| 15 | { |
| 16 | public: |
| 17 | virtual ~ManagerMock() = default; |
| 18 | |
| 19 | MOCK_METHOD1(registerHandler, bool(std::unique_ptr<GenericBlobInterface>)); |
| 20 | MOCK_METHOD0(buildBlobList, uint32_t()); |
| 21 | MOCK_METHOD1(getBlobId, std::string(uint32_t)); |
| 22 | MOCK_METHOD3(open, bool(uint16_t, const std::string&, uint16_t*)); |
| 23 | MOCK_METHOD2(stat, bool(const std::string&, struct BlobMeta*)); |
| 24 | MOCK_METHOD2(stat, bool(uint16_t, struct BlobMeta*)); |
| 25 | MOCK_METHOD2(commit, bool(uint16_t, const std::vector<uint8_t>&)); |
| 26 | MOCK_METHOD1(close, bool(uint16_t)); |
| 27 | MOCK_METHOD3(read, std::vector<uint8_t>(uint16_t, uint32_t, uint32_t)); |
| 28 | MOCK_METHOD3(write, bool(uint16_t, uint32_t, const std::vector<uint8_t>&)); |
| 29 | MOCK_METHOD1(deleteBlob, bool(const std::string&)); |
Patrick Venture | 5c4b17b | 2018-10-04 10:32:22 -0700 | [diff] [blame] | 30 | MOCK_METHOD3(writeMeta, |
| 31 | bool(uint16_t, uint32_t, const std::vector<uint8_t>&)); |
Patrick Venture | ef3aead | 2018-09-12 08:53:29 -0700 | [diff] [blame] | 32 | }; |
Patrick Venture | 03f415e | 2018-10-04 10:10:58 -0700 | [diff] [blame] | 33 | |
| 34 | /* |
| 35 | * Provide a one-off implementation for now. |
| 36 | * To test this, set managerReturned as you need. |
| 37 | */ |
| 38 | ManagerInterface* managerReturned; |
| 39 | |
| 40 | ManagerInterface* getBlobManager() |
| 41 | { |
| 42 | return managerReturned; |
| 43 | } |
| 44 | |
Patrick Venture | ef3aead | 2018-09-12 08:53:29 -0700 | [diff] [blame] | 45 | } // namespace blobs |