From 596b479d839d9f85538a6ff756a81e1ef8d4abb3 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 31 May 2017 21:34:26 -0700 Subject: [PATCH] Skip default tcache testing if !opt_tcache. --- test/unit/mallctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/mallctl.c b/test/unit/mallctl.c index 8339e8c5..80b84a06 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");