summaryrefslogtreecommitdiff
path: root/test/integration/allocated.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2022-05-06 11:28:25 -0700
committerQi Wang <interwq@gwu.edu>2022-05-06 11:28:25 -0700
commit54eaed1d8b56b1aa528be3bdd1877e59c56fa90c (patch)
treee79620e0c00b1f8b6b698fbe74df6bae7d812ae2 /test/integration/allocated.c
parentea6b3e973b477b8061e0076bb257dbd7f3faa756 (diff)
parent304c919829f9f340669b61fa64867cfe5dba8021 (diff)
downloadjemalloc-master.tar.gz
Merge branch 'dev'5.3.0master
Diffstat (limited to 'test/integration/allocated.c')
-rw-r--r--test/integration/allocated.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/integration/allocated.c b/test/integration/allocated.c
index 1425fd0a..0c64272c 100644
--- a/test/integration/allocated.c
+++ b/test/integration/allocated.c
@@ -32,7 +32,7 @@ thd_start(void *arg) {
test_fail("%s(): Error in mallctl(): %s", __func__,
strerror(err));
}
- assert_u64_eq(*ap0, a0,
+ expect_u64_eq(*ap0, a0,
"\"thread.allocatedp\" should provide a pointer to internal "
"storage");
@@ -53,25 +53,25 @@ thd_start(void *arg) {
test_fail("%s(): Error in mallctl(): %s", __func__,
strerror(err));
}
- assert_u64_eq(*dp0, d0,
+ expect_u64_eq(*dp0, d0,
"\"thread.deallocatedp\" should provide a pointer to internal "
"storage");
p = malloc(1);
- assert_ptr_not_null(p, "Unexpected malloc() error");
+ expect_ptr_not_null(p, "Unexpected malloc() error");
sz = sizeof(a1);
mallctl("thread.allocated", (void *)&a1, &sz, NULL, 0);
sz = sizeof(ap1);
mallctl("thread.allocatedp", (void *)&ap1, &sz, NULL, 0);
- assert_u64_eq(*ap1, a1,
+ expect_u64_eq(*ap1, a1,
"Dereferenced \"thread.allocatedp\" value should equal "
"\"thread.allocated\" value");
- assert_ptr_eq(ap0, ap1,
+ expect_ptr_eq(ap0, ap1,
"Pointer returned by \"thread.allocatedp\" should not change");
- usize = malloc_usable_size(p);
- assert_u64_le(a0 + usize, a1,
+ usize = TEST_MALLOC_SIZE(p);
+ expect_u64_le(a0 + usize, a1,
"Allocated memory counter should increase by at least the amount "
"explicitly allocated");
@@ -81,19 +81,19 @@ thd_start(void *arg) {
mallctl("thread.deallocated", (void *)&d1, &sz, NULL, 0);
sz = sizeof(dp1);
mallctl("thread.deallocatedp", (void *)&dp1, &sz, NULL, 0);
- assert_u64_eq(*dp1, d1,
+ expect_u64_eq(*dp1, d1,
"Dereferenced \"thread.deallocatedp\" value should equal "
"\"thread.deallocated\" value");
- assert_ptr_eq(dp0, dp1,
+ expect_ptr_eq(dp0, dp1,
"Pointer returned by \"thread.deallocatedp\" should not change");
- assert_u64_le(d0 + usize, d1,
+ expect_u64_le(d0 + usize, d1,
"Deallocated memory counter should increase by at least the amount "
"explicitly deallocated");
return NULL;
label_ENOENT:
- assert_false(config_stats,
+ expect_false(config_stats,
"ENOENT should only be returned if stats are disabled");
test_skip("\"thread.allocated\" mallctl not available");
return NULL;