summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2016-02-17 14:40:33 (GMT)
committerJason Evans <jasone@canonware.com>2016-02-20 01:02:25 (GMT)
commitb24f74b8624fb43f9b562a067ca14563f45cb553 (patch)
treeb0d676f8fb59cc7daa6ca4203fa09d5fcea6a302 /test/integration
parent109712b681cd146cb88b17d743fe53314c962144 (diff)
downloadjemalloc-b24f74b8624fb43f9b562a067ca14563f45cb553.zip
jemalloc-b24f74b8624fb43f9b562a067ca14563f45cb553.tar.gz
jemalloc-b24f74b8624fb43f9b562a067ca14563f45cb553.tar.bz2
Don't rely on unpurged chunks in xallocx() test.
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/xallocx.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/integration/xallocx.c b/test/integration/xallocx.c
index 0045196..5c4998b 100644
--- a/test/integration/xallocx.c
+++ b/test/integration/xallocx.c
@@ -305,63 +305,63 @@ TEST_END
TEST_BEGIN(test_extra_huge)
{
int flags = MALLOCX_ARENA(arena_ind());
- size_t largemax, huge0, huge1, huge2, hugemax;
+ size_t largemax, huge1, huge2, huge3, hugemax;
void *p;
/* Get size classes. */
largemax = get_large_size(get_nlarge()-1);
- huge0 = get_huge_size(0);
huge1 = get_huge_size(1);
huge2 = get_huge_size(2);
+ huge3 = get_huge_size(3);
hugemax = get_huge_size(get_nhuge()-1);
- p = mallocx(huge2, flags);
+ p = mallocx(huge3, flags);
assert_ptr_not_null(p, "Unexpected mallocx() error");
- assert_zu_eq(xallocx(p, huge2, 0, flags), huge2,
+ assert_zu_eq(xallocx(p, huge3, 0, flags), huge3,
"Unexpected xallocx() behavior");
/* Test size decrease with zero extra. */
- assert_zu_ge(xallocx(p, huge0, 0, flags), huge0,
+ assert_zu_ge(xallocx(p, huge1, 0, flags), huge1,
"Unexpected xallocx() behavior");
- assert_zu_ge(xallocx(p, largemax, 0, flags), huge0,
+ assert_zu_ge(xallocx(p, largemax, 0, flags), huge1,
"Unexpected xallocx() behavior");
- assert_zu_eq(xallocx(p, huge2, 0, flags), huge2,
+ assert_zu_eq(xallocx(p, huge3, 0, flags), huge3,
"Unexpected xallocx() behavior");
/* Test size decrease with non-zero extra. */
- assert_zu_eq(xallocx(p, huge0, huge2 - huge0, flags), huge2,
+ assert_zu_eq(xallocx(p, huge1, huge3 - huge1, flags), huge3,
"Unexpected xallocx() behavior");
- assert_zu_eq(xallocx(p, huge1, huge2 - huge1, flags), huge2,
+ assert_zu_eq(xallocx(p, huge2, huge3 - huge2, flags), huge3,
"Unexpected xallocx() behavior");
- assert_zu_eq(xallocx(p, huge0, huge1 - huge0, flags), huge1,
+ assert_zu_eq(xallocx(p, huge1, huge2 - huge1, flags), huge2,
"Unexpected xallocx() behavior");
- assert_zu_ge(xallocx(p, largemax, huge0 - largemax, flags), huge0,
+ assert_zu_ge(xallocx(p, largemax, huge1 - largemax, flags), huge1,
"Unexpected xallocx() behavior");
- assert_zu_ge(xallocx(p, huge0, 0, flags), huge0,
+ assert_zu_ge(xallocx(p, huge1, 0, flags), huge1,
"Unexpected xallocx() behavior");
/* Test size increase with zero extra. */
- assert_zu_le(xallocx(p, huge2, 0, flags), huge2,
+ assert_zu_le(xallocx(p, huge3, 0, flags), huge3,
"Unexpected xallocx() behavior");
- assert_zu_le(xallocx(p, hugemax+1, 0, flags), huge2,
+ assert_zu_le(xallocx(p, hugemax+1, 0, flags), huge3,
"Unexpected xallocx() behavior");
- assert_zu_ge(xallocx(p, huge0, 0, flags), huge0,
+ assert_zu_ge(xallocx(p, huge1, 0, flags), huge1,
"Unexpected xallocx() behavior");
/* Test size increase with non-zero extra. */
- assert_zu_le(xallocx(p, huge0, SIZE_T_MAX - huge0, flags), hugemax,
+ assert_zu_le(xallocx(p, huge1, SIZE_T_MAX - huge1, flags), hugemax,
"Unexpected xallocx() behavior");
- assert_zu_ge(xallocx(p, huge0, 0, flags), huge0,
+ assert_zu_ge(xallocx(p, huge1, 0, flags), huge1,
"Unexpected xallocx() behavior");
/* Test size increase with non-zero extra. */
- assert_zu_le(xallocx(p, huge0, huge2 - huge0, flags), huge2,
+ assert_zu_le(xallocx(p, huge1, huge3 - huge1, flags), huge3,
"Unexpected xallocx() behavior");
- assert_zu_eq(xallocx(p, huge2, 0, flags), huge2,
+ assert_zu_eq(xallocx(p, huge3, 0, flags), huge3,
"Unexpected xallocx() behavior");
/* Test size+extra overflow. */
- assert_zu_le(xallocx(p, huge2, hugemax - huge2 + 1, flags), hugemax,
+ assert_zu_le(xallocx(p, huge3, hugemax - huge3 + 1, flags), hugemax,
"Unexpected xallocx() behavior");
dallocx(p, flags);