From: Martin Mares Date: Fri, 21 Sep 2007 09:15:56 +0000 (+0200) Subject: The graph tests are able to generate empty input now. X-Git-Tag: holmes-import~506^2~12^2 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=55d8779c67526f675bc053d70fac5fccbd8c29bf;p=libucw.git The graph tests are able to generate empty input now. --- diff --git a/lib/sorter/sort-test.c b/lib/sorter/sort-test.c index 208de918..e7d58730 100644 --- a/lib/sorter/sort-test.c +++ b/lib/sorter/sort-test.c @@ -397,7 +397,7 @@ static int s5_gen(struct s5_pair *p) { if (s5_j >= s5_N) { - if (s5_i >= s5_N-1) + if (!s5_N || s5_i >= s5_N-1) return 0; s5_j = 0; s5_i++; @@ -520,6 +520,8 @@ test_graph(uns mode, u64 size) uns N = 3; while ((u64)N*(N+2)*4 < size) N = nextprime(N); + if (!size) + N = 0; msg(L_INFO, ">>> Graph%s (N=%u)", (mode ? "" : " with custom presorting"), N); s5_N = N; s5_K = N/4*3;