summaryrefslogtreecommitdiffstats
path: root/test/unit/mallctl.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-06-01 04:34:26 (GMT)
committerJason Evans <jasone@canonware.com>2017-06-01 15:55:27 (GMT)
commit596b479d839d9f85538a6ff756a81e1ef8d4abb3 (patch)
treece8bbd2c38e8dfd0feb27897671cc7fd1b15b92b /test/unit/mallctl.c
parentfa35463d56be52a3a6e6b513fbb6cc6e63d9bcc7 (diff)
downloadjemalloc-596b479d839d9f85538a6ff756a81e1ef8d4abb3.zip
jemalloc-596b479d839d9f85538a6ff756a81e1ef8d4abb3.tar.gz
jemalloc-596b479d839d9f85538a6ff756a81e1ef8d4abb3.tar.bz2
Skip default tcache testing if !opt_tcache.
Diffstat (limited to 'test/unit/mallctl.c')
-rw-r--r--test/unit/mallctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/mallctl.c b/test/unit/mallctl.c
index 8339e8c..80b84a0 100644
--- a/test/unit/mallctl.c
+++ b/test/unit/mallctl.c
@@ -210,12 +210,12 @@ TEST_BEGIN(test_manpage_example) {
TEST_END
TEST_BEGIN(test_tcache_none) {
- void *p0, *q, *p1;
+ test_skip_if(!opt_tcache);
/* Allocate p and q. */
- p0 = mallocx(42, 0);
+ void *p0 = mallocx(42, 0);
assert_ptr_not_null(p0, "Unexpected mallocx() failure");
- q = mallocx(42, 0);
+ void *q = mallocx(42, 0);
assert_ptr_not_null(q, "Unexpected mallocx() failure");
/* Deallocate p and q, but bypass the tcache for q. */
@@ -223,7 +223,7 @@ TEST_BEGIN(test_tcache_none) {
dallocx(q, MALLOCX_TCACHE_NONE);
/* Make sure that tcache-based allocation returns p, not q. */
- p1 = mallocx(42, 0);
+ void *p1 = mallocx(42, 0);
assert_ptr_not_null(p1, "Unexpected mallocx() failure");
assert_ptr_eq(p0, p1, "Expected tcache to allocate cached region");