summaryrefslogtreecommitdiffstats
path: root/test/unit/junk.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-05-31 18:56:31 (GMT)
committerJason Evans <jasone@canonware.com>2017-06-01 15:55:27 (GMT)
commitfd0fa003e188e94beab8871ff0c17ea4a8a2c706 (patch)
treeb62c73dff9887ffbfeee63f33b338d6ff5eb591a /test/unit/junk.c
parentb511232fcd8aeb85d5dc8e0515539baa5d333991 (diff)
downloadjemalloc-fd0fa003e188e94beab8871ff0c17ea4a8a2c706.zip
jemalloc-fd0fa003e188e94beab8871ff0c17ea4a8a2c706.tar.gz
jemalloc-fd0fa003e188e94beab8871ff0c17ea4a8a2c706.tar.bz2
Test with background_thread:true.
Add testing for background_thread:true, and condition a xallocx() --> rallocx() escalation assertion to allow for spurious in-place rallocx() following xallocx() failure.
Diffstat (limited to 'test/unit/junk.c')
-rw-r--r--test/unit/junk.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/unit/junk.c b/test/unit/junk.c
index f9390e4..fd0e65b 100644
--- a/test/unit/junk.c
+++ b/test/unit/junk.c
@@ -96,12 +96,15 @@ test_junk(size_t sz_min, size_t sz_max) {
t = (uint8_t *)rallocx(s, sz+1, 0);
assert_ptr_not_null((void *)t,
"Unexpected rallocx() failure");
- assert_ptr_ne(s, t, "Unexpected in-place rallocx()");
assert_zu_ge(sallocx(t, 0), sz+1,
"Unexpectedly small rallocx() result");
- assert_true(!opt_junk_free || saw_junking,
- "Expected region of size %zu to be junk-filled",
- sz);
+ if (!background_thread_enabled()) {
+ assert_ptr_ne(s, t,
+ "Unexpected in-place rallocx()");
+ assert_true(!opt_junk_free || saw_junking,
+ "Expected region of size %zu to be "
+ "junk-filled", sz);
+ }
s = t;
}
}