Mercurial > dovecot > core-2.2
view src/lib/test-primes.c @ 17130:add8c00fb3cc
Updated copyright notices to include year 2014.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 04 Feb 2014 16:23:22 -0500 |
parents | 36ef72481934 |
children | 3009a1a6f6d5 |
line wrap: on
line source
/* Copyright (c) 2007-2014 Dovecot authors, see the included COPYING file */ #include "test-lib.h" #include "primes.h" void test_primes(void) { unsigned int i, j, num; bool success; success = primes_closest(0) > 0; for (num = 1; num < 1024; num++) { if (primes_closest(num) < num) success = FALSE; } for (i = 10; i < 32; i++) { num = (1U << i) - 100; for (j = 0; j < 200; j++, num++) { if (primes_closest(num) < num) success = FALSE; } } test_out("primes_closest()", success); }