items.len,
items.len * (sizeof(struct YACItem) + (NoOffsets ? 0 : sizeof(size_t))));
}
+ if (off < len) {
+ char *hex = HexEnc(buf + off, len - off);
+ printf("tail: %s\n", hex);
+ free(hex);
+ }
if (doEncode) {
unsigned char *dst = malloc(len);
assert(dst != NULL);
+ size_t lenExpected = off;
off = 0;
assert(YACItemsEncode(&items, 0, &off, dst, len));
- assert(off == len);
- assert(memcmp(dst, buf, len) == 0);
+ assert(off == lenExpected);
+ assert(memcmp(dst, buf, lenExpected) == 0);
}
return EXIT_SUCCESS;
}