From db4fd66eaf6f56a0fc90734ede702c3c92ffda9f Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Tue, 1 Dec 2015 18:12:21 +0100 Subject: [PATCH] try it with a smaller alloc --- src/t_misc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/t_misc.c b/src/t_misc.c index 8cd73dcb..59d6260d 100644 --- a/src/t_misc.c +++ b/src/t_misc.c @@ -32,8 +32,9 @@ static void test_tt_registry(void) { // perform a big allocation during parsing to trigger out-of-memory handling static HParsedToken *act_big_alloc(const HParseResult *r, void *user) { - void *buf = h_arena_malloc(r->arena, 1024*1024*1024); + void *buf = h_arena_malloc(r->arena, 500*1024*1024); assert(buf != NULL); + g_test_message("Memory allocation was supposed to fail"); return NULL; } static void test_oom(void) { @@ -44,7 +45,7 @@ static void test_oom(void) { int i; i = getrlimit(RLIMIT_DATA, &bak); assert(i == 0); - lim.rlim_cur = 1000*1024*1024; // never enough + lim.rlim_cur = 499*1024*1024; // never enough if(lim.rlim_cur > bak.rlim_max) lim.rlim_cur = bak.rlim_max; lim.rlim_max = bak.rlim_max; -- GitLab