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>
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 @@
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