From: Martin Mares Date: Fri, 9 Feb 2007 18:51:51 +0000 (+0100) Subject: Allow empty test cases. X-Git-Tag: holmes-import~506^2~13^2~163 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ddffc1e06a78085524bec742aef746c2cc5bd131;p=libucw.git Allow empty test cases. --- diff --git a/lib/sorter/sort-test.c b/lib/sorter/sort-test.c index 814a4ad6..f0c52e63 100644 --- a/lib/sorter/sort-test.c +++ b/lib/sorter/sort-test.c @@ -51,7 +51,7 @@ struct key1 { static void test_int(int mode, u64 size) { - uns N = nextprime(MIN(size/4, 0xffff0000)); + uns N = size ? nextprime(MIN(size/4, 0xffff0000)) : 0; uns K = N/4*3; log(L_INFO, ">>> Integers (%s, N=%d)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); @@ -111,7 +111,7 @@ test_counted(int mode, u64 size) uns mult = 2; while (items/(2*mult) > 0xffff0000) mult++; - uns N = nextprime(items/(2*mult)); + uns N = items ? nextprime(items/(2*mult)) : 0; uns K = N/4*3; log(L_INFO, ">>> Counted integers (%s, N=%d, mult=%d)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N, mult);