Mercurial > hg > CbC > CbC_llvm
comparison unittests/Support/CRCTest.cpp @ 148:63bd29f05246
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 19:46:37 +0900 |
parents | c2174574ed3a |
children |
comparison
equal
deleted
inserted
replaced
146:3fc4d5c3e21e | 148:63bd29f05246 |
---|---|
1 //===- llvm/unittest/Support/CRCTest.cpp - CRC tests ----------------------===// | |
2 // | |
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 | |
6 // | |
7 //===----------------------------------------------------------------------===// | |
8 // | |
9 // This file implements unit tests for CRC calculation functions. | |
10 // | |
11 //===----------------------------------------------------------------------===// | |
12 | |
13 #include "llvm/Support/CRC.h" | |
14 #include "gtest/gtest.h" | |
15 | |
16 using namespace llvm; | |
17 | |
18 namespace { | |
19 | |
20 TEST(CRCTest, CRC32) { | |
21 EXPECT_EQ(0x414FA339U, | |
22 llvm::crc32( | |
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"))); | |
27 } | |
28 | |
29 } // end anonymous namespace |