From ddffc1e06a78085524bec742aef746c2cc5bd131 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 9 Feb 2007 19:51:51 +0100 Subject: [PATCH] Allow empty test cases. --- lib/sorter/sort-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5