MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/util/crc32_test.cc:31–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace arrow {
30
31TEST(Crc32Test, Basic) {
32 // use the string "123456789" in ASCII as test data.
33 constexpr uint32_t TEST_CRC32_RESULT = 0xCBF43926;
34 constexpr size_t TEST_CRC32_LENGTH = 9;
35 std::array<unsigned char, TEST_CRC32_LENGTH> std_data = {0x31, 0x32, 0x33, 0x34, 0x35,
36 0x36, 0x37, 0x38, 0x39};
37 const size_t std_data_len = sizeof(std_data) / sizeof(std_data[0]);
38 EXPECT_EQ(TEST_CRC32_RESULT, internal::crc32(0, &std_data[0], std_data_len));
39
40 for (size_t i = 1; i < std_data_len - 1; ++i) {
41 uint32_t crc1 = internal::crc32(0, &std_data[0], i);
42 EXPECT_EQ(TEST_CRC32_RESULT, internal::crc32(crc1, &std_data[i], std_data_len - i));
43 }
44}
45
46TEST(Crc32Test, matchesBoost32Type) {
47 const size_t BUFFER_SIZE = 512 * 1024 * sizeof(uint64_t);

Callers

nothing calls this directly

Calls 2

crc32Function · 0.85
resizeMethod · 0.80

Tested by

no test coverage detected