From: Timo Sirainen Date: Mon, 27 Nov 2017 13:12:45 +0000 (+0200) Subject: lib: Fix mempool-alloconly & mempool-allocfree unit tests X-Git-Tag: 2.3.0.rc1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7d1bd5be687bbb125ccfb5c685491414280ddac;p=thirdparty%2Fdovecot%2Fcore.git lib: Fix mempool-alloconly & mempool-allocfree unit tests The "physically impossible size" test was supposed to test calloc()==NULL failure, but in reality it was triggering asserts before that. --- diff --git a/src/lib/test-mempool-allocfree.c b/src/lib/test-mempool-allocfree.c index 9a5e179f94..ab1e664390 100644 --- a/src/lib/test-mempool-allocfree.c +++ b/src/lib/test-mempool-allocfree.c @@ -113,7 +113,7 @@ enum fatal_test_state fatal_mempool_allocfree(unsigned int stage) return FATAL_TEST_FAILURE; case 2: /* physically impossible size */ - (void)p_malloc(pool, SSIZE_T_MAX - (size_t)MEM_ALIGN(1)); + (void)p_malloc(pool, SSIZE_T_MAX - 1024); return FATAL_TEST_FAILURE; /* Continue with other tests as follows: diff --git a/src/lib/test-mempool-alloconly.c b/src/lib/test-mempool-alloconly.c index 5ecd79ca71..1f2094db18 100644 --- a/src/lib/test-mempool-alloconly.c +++ b/src/lib/test-mempool-alloconly.c @@ -72,7 +72,7 @@ enum fatal_test_state fatal_mempool_alloconly(unsigned int stage) return FATAL_TEST_FAILURE; case 2: /* physically impossible size */ - (void)p_malloc(pool, SSIZE_T_MAX - (size_t)MEM_ALIGN(1)); + (void)p_malloc(pool, SSIZE_T_MAX - 1024); return FATAL_TEST_FAILURE; /* Continue with other tests as follows: