5static void test_decode(
const std::string& encoded,
const std::string& decoded)
7 auto [buf, bufSize] = HexDump::decode(encoded);
8 REQUIRE(bufSize == decoded.size());
12static void test(
const std::string& decoded,
const std::string& encoded)
14 CHECK(HexDump::encode(std::span{
reinterpret_cast<const uint8_t*
>(decoded.data()),
17 test_decode(encoded, decoded);
25 test(
"abc",
"61 62 63");
26 test(
"0123456789",
"30 31 32 33 34 35 36 37 38 39");
27 test(
"abcdefghijklmnopqrstuvwxyz",
28 "61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70\n"
29 "71 72 73 74 75 76 77 78 79 7A");
30 test(
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
31 "30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46\n"
32 "47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56\n"
33 "57 58 59 5A 61 62 63 64 65 66 67 68 69 6A 6B 6C\n"
34 "6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A");
35 test(
"111111111111111111111111111111111111111111111111111111111111111111111111111111"
36 "111111111111111111111111111111111111111111111111111111111111111111111111111111"
37 "111111111111111111111111111111111111111111111111111111111111111111111111111111"
38 "111111111111111111111111111111111111111111111",
39 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
40 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
41 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
42 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
43 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
44 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
45 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
46 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
47 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
48 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
49 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
50 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
51 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
52 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
53 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
54 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
55 "31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31\n"
56 "31 31 31 31 31 31 31");
60 test_decode(
"30 31\n32\n33 34",
"01234");
62 test_decode(
"3031323334",
"01234");
64 test_decode(
"30|31G32g33+34",
"01234");
66 test_decode(
"4A+4b4c\n4d",
"JKLM");
bool equal(InputRange1 &&range1, InputRange2 &&range2, Pred pred={}, Proj1 proj1={}, Proj2 proj2={})