18 SECTION(
"'3 x A1' in a loop") {
22 SECTION(
"'3 x A1' in one chunk") {
23 static constexpr std::array<uint8_t, 3> buf = { 0xA1, 0xA1, 0xA1 };
27 SECTION(
"'3 x A1' via init") {
28 crc.
init({0xA1, 0xA1, 0xA1});
35 SECTION(
"'123456789' in a loop") {
36 for (
char c : {
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'}) crc.
update(c);
39 SECTION(
"'123456789' in one chunk") {
40 static constexpr const char*
const digits =
"123456789";
41 crc.
update(std::span{std::bit_cast<const uint8_t*>(digits), 9});
45 SECTION(
"512 bytes") {
46 std::array<uint8_t, 512> buf;
47 for (
auto i :
xrange(512)) buf[i] = narrow_cast<uint8_t>(i & 255);
48 SECTION(
"in a loop") {
49 for (
char c : buf) crc.
update(c);
52 SECTION(
"in one chunk") {
61 SECTION(
"'11' in a loop") {
62 for (uint8_t c : {uint8_t(0x11)}) crc.
update(c);
65 SECTION(
"'11' in one chunk") {
66 static constexpr std::array<uint8_t, 1> buf = {0x11};
70 SECTION(
"'11' via init") {
75 SECTION(
"'11 22' in a loop") {
76 for (uint8_t c : {uint8_t(0x11), uint8_t(0x22)}) crc.
update(c);
79 SECTION(
"'11 22' in one chunk") {
80 static constexpr std::array<uint8_t, 2> buf = {0x11, 0x22};
84 SECTION(
"'11 22' via init") {
85 crc.
init({0x11, 0x22});
89 SECTION(
"'11 22 33' in a loop") {
90 for (uint8_t c : {uint8_t(0x11), uint8_t(0x22), uint8_t(0x33)}) crc.
update(c);
93 SECTION(
"'11 22 33' in one chunk") {
94 static constexpr std::array<uint8_t, 3> buf = {0x11, 0x22, 0x33};
98 SECTION(
"'11 22 33' via init") {
99 crc.
init({0x11, 0x22, 0x33});
103 SECTION(
"'11 22 33 44' in a loop") {
104 for (uint8_t c : {uint8_t(0x11), uint8_t(0x22), uint8_t(0x33), uint8_t(0x44)}) crc.
update(c);
107 SECTION(
"'11 22 33 44' in one chunk") {
108 static constexpr std::array<uint8_t, 4> buf = {0x11, 0x22, 0x33, 0x44};
112 SECTION(
"'11 22 33 44' via init") {
113 crc.
init({0x11, 0x22, 0x33, 0x44});