13 BASE16("foo") = "666F6F"
14 BASE16("foob") = "666F6F62"
15 BASE16("fooba") = "666F6F6261"
16 BASE16("foobar") = "666F6F626172"
27 {"foo", "666F6F", "foo"},
28 {"foob", "666F6F62", "foob"},
29 {"fooba", "666F6F6261", "fooba"},
30 {"foobar", "666F6F626172", "foobar"},
35 char buf
[1024], buf2
[1024], mask
;
37 for (size_t i
= 0; i
< sizeof(tests0
)/sizeof(tests0
[0]); ++i
) {
38 base16_to(buf
, (const u8
*)tests0
[i
].in
, strlen(tests0
[i
].in
));
39 assert(strcmp(buf
, tests0
[i
].out
) == 0);
40 r
= base16_from((u8
*)buf2
, (u8
*)&mask
, buf
);
42 //fprintf(stderr, "r:%d, mask:%02X\n", (int)r, ((unsigned int)mask) & 0xFF);
43 //assert(r == strlen(buf2));
44 //assert(r == strlen(tests0[i].rev));
45 //fprintf(stderr, "%s -- %s\n", buf2, tests0[i].rev);
46 assert(strcmp(buf2
, tests0
[i
].rev
) == 0);