1 //===- llvm/unittest/Support/CRCTest.cpp - CRC tests ----------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements unit tests for CRC calculation functions.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/Support/CRC.h"
14 #include "gtest/gtest.h"
20 TEST(CRCTest
, CRC32
) {
21 EXPECT_EQ(0x414FA339U
,
23 0, StringRef("The quick brown fox jumps over the lazy dog")));
24 // CRC-32/ISO-HDLC test vector
25 // http://reveng.sourceforge.net/crc-catalogue/17plus.htm#crc.cat.crc-32c
26 EXPECT_EQ(0xCBF43926U
, llvm::crc32(0, StringRef("123456789")));
29 } // end anonymous namespace