Fix warnings and a test failure exposed on CentOS 6.3.
This commit is contained in:
parent
fb1775e47e
commit
35f1bc4e4b
@ -148,6 +148,9 @@ TEST_BEGIN(test_stats_arenas_small)
|
|||||||
p = mallocx(SMALL_MAXCLASS, 0);
|
p = mallocx(SMALL_MAXCLASS, 0);
|
||||||
assert_ptr_not_null(p, "Unexpected mallocx() failure");
|
assert_ptr_not_null(p, "Unexpected mallocx() failure");
|
||||||
|
|
||||||
|
assert_d_eq(mallctl("thread.tcache.flush", NULL, NULL, NULL, 0),
|
||||||
|
config_tcache ? 0 : ENOENT, "Unexpected mallctl() result");
|
||||||
|
|
||||||
assert_d_eq(mallctl("epoch", NULL, NULL, &epoch, sizeof(epoch)), 0,
|
assert_d_eq(mallctl("epoch", NULL, NULL, &epoch, sizeof(epoch)), 0,
|
||||||
"Unexpected mallctl() failure");
|
"Unexpected mallctl() failure");
|
||||||
|
|
||||||
@ -164,13 +167,13 @@ TEST_BEGIN(test_stats_arenas_small)
|
|||||||
|
|
||||||
if (config_stats) {
|
if (config_stats) {
|
||||||
assert_zu_gt(allocated, 0,
|
assert_zu_gt(allocated, 0,
|
||||||
"allocated should be greated than zero");
|
"allocated should be greater than zero");
|
||||||
assert_u64_gt(nmalloc, 0,
|
assert_u64_gt(nmalloc, 0,
|
||||||
"nmalloc should be no greater than zero");
|
"nmalloc should be no greater than zero");
|
||||||
assert_u64_ge(nmalloc, ndalloc,
|
assert_u64_ge(nmalloc, ndalloc,
|
||||||
"nmalloc should be at least as large as ndalloc");
|
"nmalloc should be at least as large as ndalloc");
|
||||||
assert_u64_gt(nrequests, 0,
|
assert_u64_gt(nrequests, 0,
|
||||||
"nrequests should be no greater than zero");
|
"nrequests should be greater than zero");
|
||||||
}
|
}
|
||||||
|
|
||||||
dallocx(p, 0);
|
dallocx(p, 0);
|
||||||
|
@ -151,7 +151,6 @@ TEST_BEGIN(test_malloc_snprintf_truncated)
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
for (len = 1; len < BUFLEN; len++) {
|
for (len = 1; len < BUFLEN; len++) {
|
||||||
TEST("", "");
|
|
||||||
TEST("012346789", "012346789");
|
TEST("012346789", "012346789");
|
||||||
TEST("a0123b", "a%sb", "0123");
|
TEST("a0123b", "a%sb", "0123");
|
||||||
TEST("a01234567", "a%s%s", "0123", "4567");
|
TEST("a01234567", "a%s%s", "0123", "4567");
|
||||||
@ -180,7 +179,6 @@ TEST_BEGIN(test_malloc_snprintf)
|
|||||||
assert_d_eq(result, strlen(expected_str), "Unexpected result"); \
|
assert_d_eq(result, strlen(expected_str), "Unexpected result"); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
TEST("", "");
|
|
||||||
TEST("hello", "hello");
|
TEST("hello", "hello");
|
||||||
|
|
||||||
TEST("a0123b", "a%sb", "0123");
|
TEST("a0123b", "a%sb", "0123");
|
||||||
|
Loading…
Reference in New Issue
Block a user