diff options
author | Patrick Venture <venture@google.com> | 2019-03-07 12:48:32 -0800 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2019-03-08 13:10:01 -0800 |
commit | de8a16e2e85f49e142461b7e6fe901d3f8740fdf (patch) | |
tree | 065055f299e232874190c8e921d7960b9f434cd4 /test/crc_unittest.cpp | |
parent | b15d654ed1f6804fb2e82a5cfe97eaf35b83529e (diff) | |
download | phosphor-ipmi-blobs-de8a16e2e85f49e142461b7e6fe901d3f8740fdf.tar.gz phosphor-ipmi-blobs-de8a16e2e85f49e142461b7e6fe901d3f8740fdf.zip |
use ipmiblob library from ipmi-blob-tool
Drop all code that is now handled by the ipmiblob library provided by
the new ipmi-blob-tool. This is a library that can be included on the
BMC if necessary, but relies on nothing that is strictly meant for the
BMC.
Change-Id: I2b02ae0d432e84c08e598d27eef85b57c06a70fc
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'test/crc_unittest.cpp')
-rw-r--r-- | test/crc_unittest.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/test/crc_unittest.cpp b/test/crc_unittest.cpp deleted file mode 100644 index fb69cb4..0000000 --- a/test/crc_unittest.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "crc.hpp" - -#include <string> -#include <vector> - -#include <gtest/gtest.h> - -namespace blobs -{ - -TEST(Crc16Test, VerifyCrcValue) -{ - // Verify the crc16 is producing the value we expect. - - // Origin: security/crypta/ipmi/portable/ipmi_utils_test.cc - struct CrcTestVector - { - std::string input; - uint16_t output; - }; - - std::string longString = - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - "AAAAAAAAAAAAAAAA"; - - std::vector<CrcTestVector> vectors({{"", 0x1D0F}, - {"A", 0x9479}, - {"123456789", 0xE5CC}, - {longString, 0xE938}}); - - Crc16 crc; - - for (const CrcTestVector& testVector : vectors) - { - crc.clear(); - auto data = reinterpret_cast<const uint8_t*>(testVector.input.data()); - crc.compute(data, testVector.input.size()); - EXPECT_EQ(crc.get(), testVector.output); - } -} -} // namespace blobs |