test-mempool-alloconly.c revision 8b2839664b4b1730d7d5fd5c1856e97e34934a3d
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen/* Copyright (c) 2007-2014 Dovecot authors, see the included COPYING file */
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainenstatic bool mem_has_bytes(const void *mem, size_t size, uint8_t b)
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen unsigned int i;
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen for (i = 0; i < size; i++) {
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen unsigned int i, j, k;
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen for (i = 0; i < 64; i++) {
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen pool = pool_alloconly_create(MEMPOOL_GROWING"test", i);
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen case 0: /* forbidden size */
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen pool = pool_alloconly_create(MEMPOOL_GROWING"fatal", 1);
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen (void)p_malloc(pool, SSIZE_T_MAX - (size_t)MEM_ALIGN(1));
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen /* Continue with other tests as follows:
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen something_fatal();
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen return FATAL_TEST_FAILURE;
f6d57a2c182f63cd52819f0abb3c3d9f828afe19Timo Sirainen /* Either our tests have finished, or the test suite has got confused. */