Fix message formatting errors uncovered by p_test_fail() refactoring.
This commit is contained in:
parent
e3f27cfced
commit
ab8c79fdaf
@ -29,7 +29,7 @@ TEST_BEGIN(test_count_insert_search_remove)
|
|||||||
assert_false(ckh_new(&ckh, 2, ckh_string_hash, ckh_string_keycomp),
|
assert_false(ckh_new(&ckh, 2, ckh_string_hash, ckh_string_keycomp),
|
||||||
"Unexpected ckh_new() error");
|
"Unexpected ckh_new() error");
|
||||||
assert_zu_eq(ckh_count(&ckh), 0,
|
assert_zu_eq(ckh_count(&ckh), 0,
|
||||||
"ckh_count() should return %zu, but it returned %zu", 0,
|
"ckh_count() should return %zu, but it returned %zu", ZU(0),
|
||||||
ckh_count(&ckh));
|
ckh_count(&ckh));
|
||||||
|
|
||||||
/* Insert. */
|
/* Insert. */
|
||||||
@ -101,11 +101,11 @@ TEST_END
|
|||||||
|
|
||||||
TEST_BEGIN(test_insert_iter_remove)
|
TEST_BEGIN(test_insert_iter_remove)
|
||||||
{
|
{
|
||||||
#define NITEMS 1000
|
#define NITEMS ZU(1000)
|
||||||
ckh_t ckh;
|
ckh_t ckh;
|
||||||
void **p[NITEMS];
|
void **p[NITEMS];
|
||||||
void *q, *r;
|
void *q, *r;
|
||||||
unsigned i;
|
size_t i;
|
||||||
|
|
||||||
assert_false(ckh_new(&ckh, 2, ckh_pointer_hash, ckh_pointer_keycomp),
|
assert_false(ckh_new(&ckh, 2, ckh_pointer_hash, ckh_pointer_keycomp),
|
||||||
"Unexpected ckh_new() error");
|
"Unexpected ckh_new() error");
|
||||||
@ -116,7 +116,7 @@ TEST_BEGIN(test_insert_iter_remove)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < NITEMS; i++) {
|
for (i = 0; i < NITEMS; i++) {
|
||||||
unsigned j;
|
size_t j;
|
||||||
|
|
||||||
for (j = i; j < NITEMS; j++) {
|
for (j = i; j < NITEMS; j++) {
|
||||||
assert_false(ckh_insert(&ckh, p[j], p[j]),
|
assert_false(ckh_insert(&ckh, p[j], p[j]),
|
||||||
@ -152,7 +152,7 @@ TEST_BEGIN(test_insert_iter_remove)
|
|||||||
|
|
||||||
for (tabind = 0; ckh_iter(&ckh, &tabind, &q, &r) ==
|
for (tabind = 0; ckh_iter(&ckh, &tabind, &q, &r) ==
|
||||||
false;) {
|
false;) {
|
||||||
unsigned k;
|
size_t k;
|
||||||
|
|
||||||
assert_ptr_eq(q, r, "Key and val not equal");
|
assert_ptr_eq(q, r, "Key and val not equal");
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ TEST_BEGIN(test_insert_iter_remove)
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert_zu_eq(ckh_count(&ckh), 0,
|
assert_zu_eq(ckh_count(&ckh), 0,
|
||||||
"ckh_count() should return %zu, but it returned %zu", 0,
|
"ckh_count() should return %zu, but it returned %zu", ZU(0),
|
||||||
ckh_count(&ckh));
|
ckh_count(&ckh));
|
||||||
ckh_delete(&ckh);
|
ckh_delete(&ckh);
|
||||||
#undef NITEMS
|
#undef NITEMS
|
||||||
|
@ -73,7 +73,7 @@ test_junk(size_t sz_min, size_t sz_max)
|
|||||||
if (sz_prev > 0) {
|
if (sz_prev > 0) {
|
||||||
assert_c_eq(s[0], 'a',
|
assert_c_eq(s[0], 'a',
|
||||||
"Previously allocated byte %zu/%zu is corrupted",
|
"Previously allocated byte %zu/%zu is corrupted",
|
||||||
0, sz_prev);
|
ZU(0), sz_prev);
|
||||||
assert_c_eq(s[sz_prev-1], 'a',
|
assert_c_eq(s[sz_prev-1], 'a',
|
||||||
"Previously allocated byte %zu/%zu is corrupted",
|
"Previously allocated byte %zu/%zu is corrupted",
|
||||||
sz_prev-1, sz_prev);
|
sz_prev-1, sz_prev);
|
||||||
|
@ -21,7 +21,7 @@ quarantine_clear(void)
|
|||||||
|
|
||||||
TEST_BEGIN(test_quarantine)
|
TEST_BEGIN(test_quarantine)
|
||||||
{
|
{
|
||||||
#define SZ 256
|
#define SZ ZU(256)
|
||||||
#define NQUARANTINED (QUARANTINE_SIZE/SZ)
|
#define NQUARANTINED (QUARANTINE_SIZE/SZ)
|
||||||
void *quarantined[NQUARANTINED+1];
|
void *quarantined[NQUARANTINED+1];
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
@ -48,8 +48,9 @@ TEST_BEGIN(test_rtree_bits)
|
|||||||
assert_u_eq(rtree_get(rtree, keys[k]), 1,
|
assert_u_eq(rtree_get(rtree, keys[k]), 1,
|
||||||
"rtree_get() should return previously set "
|
"rtree_get() should return previously set "
|
||||||
"value and ignore insignificant key bits; "
|
"value and ignore insignificant key bits; "
|
||||||
"i=%u, j=%u, k=%u, set key=%#x, "
|
"i=%u, j=%u, k=%u, set key=%#"PRIxPTR", "
|
||||||
"get key=%#x", i, j, k, keys[j], keys[k]);
|
"get key=%#"PRIxPTR, i, j, k, keys[j],
|
||||||
|
keys[k]);
|
||||||
}
|
}
|
||||||
assert_u_eq(rtree_get(rtree,
|
assert_u_eq(rtree_get(rtree,
|
||||||
(((uintptr_t)1) << (sizeof(uintptr_t)*8-i))), 0,
|
(((uintptr_t)1) << (sizeof(uintptr_t)*8-i))), 0,
|
||||||
|
@ -20,7 +20,7 @@ test_zero(size_t sz_min, size_t sz_max)
|
|||||||
if (sz_prev > 0) {
|
if (sz_prev > 0) {
|
||||||
assert_c_eq(s[0], 'a',
|
assert_c_eq(s[0], 'a',
|
||||||
"Previously allocated byte %zu/%zu is corrupted",
|
"Previously allocated byte %zu/%zu is corrupted",
|
||||||
0, sz_prev);
|
ZU(0), sz_prev);
|
||||||
assert_c_eq(s[sz_prev-1], 'a',
|
assert_c_eq(s[sz_prev-1], 'a',
|
||||||
"Previously allocated byte %zu/%zu is corrupted",
|
"Previously allocated byte %zu/%zu is corrupted",
|
||||||
sz_prev-1, sz_prev);
|
sz_prev-1, sz_prev);
|
||||||
|
Loading…
Reference in New Issue
Block a user