diff options
| author | Jason Evans <jasone@canonware.com> | 2017-05-31 21:34:26 -0700 |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2017-06-01 08:55:27 -0700 |
| commit | 596b479d839d9f85538a6ff756a81e1ef8d4abb3 (patch) | |
| tree | ce8bbd2c38e8dfd0feb27897671cc7fd1b15b92b /test/unit | |
| parent | fa35463d56be52a3a6e6b513fbb6cc6e63d9bcc7 (diff) | |
| download | platform_external_jemalloc_new-596b479d839d9f85538a6ff756a81e1ef8d4abb3.tar.gz platform_external_jemalloc_new-596b479d839d9f85538a6ff756a81e1ef8d4abb3.tar.bz2 platform_external_jemalloc_new-596b479d839d9f85538a6ff756a81e1ef8d4abb3.zip | |
Skip default tcache testing if !opt_tcache.
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/mallctl.c | 8 |
1 files 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"); |
