mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Add unit tests for conf parsing and its helpers
This commit is contained in:
committed by
Guangli Dai
parent
ad726adf75
commit
86b7219213
22
test/unit/conf_init_0.c
Normal file
22
test/unit/conf_init_0.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
TEST_BEGIN(test_default_dirty_decay_ms) {
|
||||
#ifdef _WIN32
|
||||
test_skip("not supported on win32");
|
||||
#endif
|
||||
|
||||
ssize_t dirty_decay_ms;
|
||||
size_t sz = sizeof(dirty_decay_ms);
|
||||
|
||||
int err = mallctl("opt.dirty_decay_ms", &dirty_decay_ms, &sz, NULL, 0);
|
||||
assert_d_eq(err, 0, "Unexpected mallctl failure");
|
||||
expect_zd_eq(dirty_decay_ms, 10000,
|
||||
"dirty_decay_ms should be the default (10000)"
|
||||
" when no global variables are set");
|
||||
}
|
||||
TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return test(test_default_dirty_decay_ms);
|
||||
}
|
||||
Reference in New Issue
Block a user