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