MCPcopy Create free account
hub / github.com/davisking/dlib / perform_test

Method perform_test

dlib/test/crc32.cpp:33–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 {}
32
33 void perform_test (
34 )
35 {
36 DLIB_TEST(crc32("davis").get_checksum() == 0x0445527C);
37
38 crc32 c, c2;
39 DLIB_TEST(c.get_checksum() == 0);
40 c.add("davis");
41 DLIB_TEST(c.get_checksum() == 0x0445527C);
42 DLIB_TEST(c2.get_checksum() == 0);
43 c2 = c;
44 DLIB_TEST(c2.get_checksum() == 0x0445527C);
45 crc32 c3(c);
46 DLIB_TEST(c3.get_checksum() == 0x0445527C);
47 c.add('a');
48 c2.add('a');
49 c3.add('a');
50 DLIB_TEST(c.get_checksum() == 0xB100C606);
51 DLIB_TEST(c2.get_checksum() == 0xB100C606);
52 DLIB_TEST(c3.get_checksum() == 0xB100C606);
53
54
55 crc32::kernel_1a cold;
56 DLIB_TEST(cold.get_checksum() == 0);
57 cold.add("davis");
58 DLIB_TEST(cold.get_checksum() == 0x0445527C);
59
60 c.clear();
61 DLIB_TEST(c.get_checksum() == 0);
62 c.add("davis");
63 DLIB_TEST(c.get_checksum() == 0x0445527C);
64
65 std::vector<char> buf;
66 for (int i = 0; i < 4000; ++i)
67 buf.push_back(i);
68 DLIB_TEST(crc32(buf) == 492662731);
69 }
70 } a;
71
72}

Callers

nothing calls this directly

Calls 4

crc32Function · 0.50
addMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected