/* If it was truncated, embiggen the string and roll from the top. */ \
if (!do_realloc(buf, size, *offset, _printed)) { \
fprintf(stderr, \
- "xkbcommon: failed to allocate %lu bytes for keymap\n", \
- (unsigned long) *size); \
+ "xkbcommon: failed to allocate %zu bytes for keymap\n", \
+ *size); \
free(*buf); \
*buf = NULL; \
_ret = false; \
char *path;
int fd;
- assert(srcdir);
- assert(asprintf(&path, "%s/test/dump.data", srcdir) != -1);
+ srcdir = srcdir ? srcdir : ".";
+ assert(asprintf(&path, "%s/test/data/dump.data", srcdir) != -1);
fd = open(path, O_RDONLY);
assert(fd >= 0);
assert(stat(path, &stat_buf) == 0);
if (strcmp(as_string, expected) != 0) {
printf("dumped map differs from expected!\n\n");
- printf("length: got %lu, expected %lu\n",
- (unsigned long) strlen(as_string),
- (unsigned long) strlen(expected));
+ printf("length: got %zu, expected %zu\n",
+ strlen(as_string), strlen(expected));
printf("result:\n%s\n", as_string);
assert(0);
}