aboutsummaryrefslogtreecommitdiff
path: root/test/_brk-test.h
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-04 11:56:13 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-04 11:56:13 +0200
commite82f82bdbeb3684684224c210fe7c50d4b2dd64d (patch)
tree7ad40178b85404820b13ceb7bd6dc5189af0e431 /test/_brk-test.h
parent790aaa14406d45dd95dea3f7d6d00da5911c6584 (diff)
Slightly improve tests
Diffstat (limited to 'test/_brk-test.h')
-rw-r--r--test/_brk-test.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/_brk-test.h b/test/_brk-test.h
index 3a66f23..69e7e0a 100644
--- a/test/_brk-test.h
+++ b/test/_brk-test.h
@@ -1,5 +1,5 @@
-#ifndef BRKTYPE
-# error "BRKTYPE is not defined!"
+#if !defined(BRKTYPE) || !defined(BRKTYPE_LONG)
+# error "BRKTYPE and BRKTYPE_LONG must be defined"
#endif
#define _GNU_SOURCE
@@ -86,8 +86,8 @@ test(struct u8view sv, int id)
/* Assert the item count is correct */
size_t items_got = CNTFUNC(buf);
if (items_got != items.len) {
- warn("case %d: expected %zu items(s) but got %zu: ‘%s’", id, items.len,
- items_got, sv.p);
+ warn("case %d: expected %zu %s(s) but got %zu: ‘%s’", id, items.len,
+ STR(BRKTYPE_LONG), items_got, sv.p);
return false;
}
@@ -96,8 +96,8 @@ test(struct u8view sv, int id)
for (size_t i = 0; ITERFUNC(&it1, &buf_cpy); i++) {
item it2 = items.buf[i];
if (!u8eq(it1, ((struct u8view){it2.buf, it2.len}))) {
- warn("case %d: expected item ‘%.*s’ but got ‘%.*s’", id,
- (int)it2.len, it2.buf, SV_PRI_ARGS(it1));
+ warn("case %d: expected %s ‘%.*s’ but got ‘%.*s’", id,
+ STR(BRKTYPE_LONG), (int)it2.len, it2.buf, SV_PRI_ARGS(it1));
return false;
}
}