Fix message formatting errors uncovered by p_test_fail() refactoring.

This commit is contained in:
Jason Evans 2014-03-30 11:21:09 -07:00
parent e3f27cfced
commit ab8c79fdaf
5 changed files with 12 additions and 11 deletions

View File

@ -29,7 +29,7 @@ TEST_BEGIN(test_count_insert_search_remove)
assert_false(ckh_new(&ckh, 2, ckh_string_hash, ckh_string_keycomp),
"Unexpected ckh_new() error");
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));
/* Insert. */
@ -101,11 +101,11 @@ TEST_END
TEST_BEGIN(test_insert_iter_remove)
{
#define NITEMS 1000
#define NITEMS ZU(1000)
ckh_t ckh;
void **p[NITEMS];
void *q, *r;
unsigned i;
size_t i;
assert_false(ckh_new(&ckh, 2, ckh_pointer_hash, ckh_pointer_keycomp),
"Unexpected ckh_new() error");
@ -116,7 +116,7 @@ TEST_BEGIN(test_insert_iter_remove)
}
for (i = 0; i < NITEMS; i++) {
unsigned j;
size_t j;
for (j = i; j < NITEMS; 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) ==
false;) {
unsigned k;
size_t k;
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,
"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_delete(&ckh);
#undef NITEMS

View File

@ -73,7 +73,7 @@ test_junk(size_t sz_min, size_t sz_max)
if (sz_prev > 0) {
assert_c_eq(s[0], 'a',
"Previously allocated byte %zu/%zu is corrupted",
0, sz_prev);
ZU(0), sz_prev);
assert_c_eq(s[sz_prev-1], 'a',
"Previously allocated byte %zu/%zu is corrupted",
sz_prev-1, sz_prev);

View File

@ -21,7 +21,7 @@ quarantine_clear(void)
TEST_BEGIN(test_quarantine)
{
#define SZ 256
#define SZ ZU(256)
#define NQUARANTINED (QUARANTINE_SIZE/SZ)
void *quarantined[NQUARANTINED+1];
size_t i, j;

View File

@ -48,8 +48,9 @@ TEST_BEGIN(test_rtree_bits)
assert_u_eq(rtree_get(rtree, keys[k]), 1,
"rtree_get() should return previously set "
"value and ignore insignificant key bits; "
"i=%u, j=%u, k=%u, set key=%#x, "
"get key=%#x", i, j, k, keys[j], keys[k]);
"i=%u, j=%u, k=%u, set key=%#"PRIxPTR", "
"get key=%#"PRIxPTR, i, j, k, keys[j],
keys[k]);
}
assert_u_eq(rtree_get(rtree,
(((uintptr_t)1) << (sizeof(uintptr_t)*8-i))), 0,

View File

@ -20,7 +20,7 @@ test_zero(size_t sz_min, size_t sz_max)
if (sz_prev > 0) {
assert_c_eq(s[0], 'a',
"Previously allocated byte %zu/%zu is corrupted",
0, sz_prev);
ZU(0), sz_prev);
assert_c_eq(s[sz_prev-1], 'a',
"Previously allocated byte %zu/%zu is corrupted",
sz_prev-1, sz_prev);