diff options
| author | Patrick Venture <venture@google.com> | 2019-03-07 12:59:29 -0800 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2019-03-07 13:03:28 -0800 |
| commit | 1681f7ff9fe112a0c3c318d562f4b46489eea02c (patch) | |
| tree | 7001687311705aa89fd695b17100babdd2d5b555 /src | |
| parent | 465469d1c074825462a7911ce1ea313230de98ce (diff) | |
| download | ipmi-blob-tool-1681f7ff9fe112a0c3c318d562f4b46489eea02c.tar.gz ipmi-blob-tool-1681f7ff9fe112a0c3c318d562f4b46489eea02c.zip | |
install crc_mock header
Install the crc_mock header for use in unit-tests in projects leveraging
this implementation of CRC.
Change-Id: Ia84caedb51e125ff3b051f93470990e44ff2540d
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 1 | ||||
| -rw-r--r-- | src/ipmiblob/test/crc_mock.hpp | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 499d389..3de0204 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,4 +20,5 @@ nobase_include_HEADERS += ipmiblob/internal/sys.hpp libipmiblob_la_SOURCES += ipmiblob/internal/sys.cpp nobase_include_HEADERS += ipmiblob/test/blob_interface_mock.hpp +nobase_include_HEADERS += ipmiblob/test/crc_mock.hpp nobase_include_HEADERS += ipmiblob/test/ipmi_interface_mock.hpp diff --git a/src/ipmiblob/test/crc_mock.hpp b/src/ipmiblob/test/crc_mock.hpp new file mode 100644 index 0000000..41c2135 --- /dev/null +++ b/src/ipmiblob/test/crc_mock.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include <cstdint> +#include <vector> + +#include <gmock/gmock.h> + +namespace ipmiblob +{ + +class CrcInterface +{ + public: + virtual ~CrcInterface() = default; + + virtual std::uint16_t + generateCrc(const std::vector<std::uint8_t>& data) const = 0; +}; + +class CrcMock : public CrcInterface +{ + public: + virtual ~CrcMock() = default; + MOCK_CONST_METHOD1(generateCrc, + std::uint16_t(const std::vector<std::uint8_t>&)); +}; + +} // namespace ipmiblob |

