blob: 00eeb6b78cb84c903ce630c9d8a952de58795156 [file] [log] [blame]
Patrick Ventureef3aead2018-09-12 08:53:29 -07001#pragma once
2
Patrick Ventureaceb4ba2018-09-27 14:50:37 -07003#include <blobs-ipmid/blobs.hpp>
4#include <blobs-ipmid/manager.hpp>
Patrick Ventureef3aead2018-09-12 08:53:29 -07005#include <memory>
6#include <string>
7
8#include <gmock/gmock.h>
9
10namespace blobs
11{
12
13class ManagerMock : public ManagerInterface
14{
15 public:
16 virtual ~ManagerMock() = default;
17
18 MOCK_METHOD1(registerHandler, bool(std::unique_ptr<GenericBlobInterface>));
19 MOCK_METHOD0(buildBlobList, uint32_t());
20 MOCK_METHOD1(getBlobId, std::string(uint32_t));
21 MOCK_METHOD3(open, bool(uint16_t, const std::string&, uint16_t*));
22 MOCK_METHOD2(stat, bool(const std::string&, struct BlobMeta*));
23 MOCK_METHOD2(stat, bool(uint16_t, struct BlobMeta*));
24 MOCK_METHOD2(commit, bool(uint16_t, const std::vector<uint8_t>&));
25 MOCK_METHOD1(close, bool(uint16_t));
26 MOCK_METHOD3(read, std::vector<uint8_t>(uint16_t, uint32_t, uint32_t));
27 MOCK_METHOD3(write, bool(uint16_t, uint32_t, const std::vector<uint8_t>&));
28 MOCK_METHOD1(deleteBlob, bool(const std::string&));
Patrick Venture5c4b17b2018-10-04 10:32:22 -070029 MOCK_METHOD3(writeMeta,
30 bool(uint16_t, uint32_t, const std::vector<uint8_t>&));
Patrick Ventureef3aead2018-09-12 08:53:29 -070031};
Patrick Venture03f415e2018-10-04 10:10:58 -070032
33/*
34 * Provide a one-off implementation for now.
35 * To test this, set managerReturned as you need.
36 */
37ManagerInterface* managerReturned;
38
39ManagerInterface* getBlobManager()
40{
41 return managerReturned;
42}
43
Patrick Ventureef3aead2018-09-12 08:53:29 -070044} // namespace blobs