test-hash-method.c revision 1b6228f23fb87733da13ac1057cf70fe513d30a0
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen/* Copyright (c) 2014 Dovecot authors, see the included COPYING file */
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainenstatic unsigned char *buf;
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainenstatic unsigned int buf_size;
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainenstatic void test_hash_method_one(const struct hash_method *method)
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen unsigned int i;
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen test_begin(t_strdup_printf("hash method %s", method->name));
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen /* make sure the code doesn't try to access data past boundaries */
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen for (i = 0; i < buf_size; i++)
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen unsigned int i;
33ca6b017b6ebbd048651b5e3d16915001dbc291Timo Sirainen buf = mmap(NULL, buf_size*2, PROT_READ | PROT_WRITE,