summaryrefslogtreecommitdiffstats
path: root/test/unit/prof_gdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/prof_gdump.c')
-rw-r--r--test/unit/prof_gdump.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/test/unit/prof_gdump.c b/test/unit/prof_gdump.c
index b88a74c..fcb434c 100644
--- a/test/unit/prof_gdump.c
+++ b/test/unit/prof_gdump.c
@@ -3,8 +3,7 @@
static bool did_prof_dump_open;
static int
-prof_dump_open_intercept(bool propagate_err, const char *filename)
-{
+prof_dump_open_intercept(bool propagate_err, const char *filename) {
int fd;
did_prof_dump_open = true;
@@ -12,11 +11,10 @@ prof_dump_open_intercept(bool propagate_err, const char *filename)
fd = open("/dev/null", O_WRONLY);
assert_d_ne(fd, -1, "Unexpected open() failure");
- return (fd);
+ return fd;
}
-TEST_BEGIN(test_gdump)
-{
+TEST_BEGIN(test_gdump) {
bool active, gdump, gdump_old;
void *p, *q, *r, *s;
size_t sz;
@@ -31,12 +29,12 @@ TEST_BEGIN(test_gdump)
prof_dump_open = prof_dump_open_intercept;
did_prof_dump_open = false;
- p = mallocx(chunksize, 0);
+ p = mallocx((1U << LG_LARGE_MINCLASS), 0);
assert_ptr_not_null(p, "Unexpected mallocx() failure");
assert_true(did_prof_dump_open, "Expected a profile dump");
did_prof_dump_open = false;
- q = mallocx(chunksize, 0);
+ q = mallocx((1U << LG_LARGE_MINCLASS), 0);
assert_ptr_not_null(q, "Unexpected mallocx() failure");
assert_true(did_prof_dump_open, "Expected a profile dump");
@@ -47,7 +45,7 @@ TEST_BEGIN(test_gdump)
"Unexpected mallctl failure while disabling prof.gdump");
assert(gdump_old);
did_prof_dump_open = false;
- r = mallocx(chunksize, 0);
+ r = mallocx((1U << LG_LARGE_MINCLASS), 0);
assert_ptr_not_null(q, "Unexpected mallocx() failure");
assert_false(did_prof_dump_open, "Unexpected profile dump");
@@ -58,7 +56,7 @@ TEST_BEGIN(test_gdump)
"Unexpected mallctl failure while enabling prof.gdump");
assert(!gdump_old);
did_prof_dump_open = false;
- s = mallocx(chunksize, 0);
+ s = mallocx((1U << LG_LARGE_MINCLASS), 0);
assert_ptr_not_null(q, "Unexpected mallocx() failure");
assert_true(did_prof_dump_open, "Expected a profile dump");
@@ -70,9 +68,7 @@ TEST_BEGIN(test_gdump)
TEST_END
int
-main(void)
-{
-
- return (test(
- test_gdump));
+main(void) {
+ return test_no_reentrancy(
+ test_gdump);
}