From: Adam Dickmeiss Date: Tue, 22 Jun 2010 08:35:44 +0000 (+0200) Subject: Return fixed hit count 24 for anything but RPN X-Git-Tag: v4.0.11~14 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=e7e9d6ab325472e8f103409f34ba853cdb314f2e Return fixed hit count 24 for anything but RPN For anything but RPN queries (CQL, CCL) return a fixed hit count in the dummy server. For RPN throw a random hit count as usual OR if a fixed hit count if any term has what appears to be an integer. --- diff --git a/ztest/ztest.c b/ztest/ztest.c index bbbb402..6cc2bff 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -133,12 +133,16 @@ static Odr_int get_term_hit(Z_RPNStructure *s) */ static Odr_int get_hit_count(Z_Query *q) { - Odr_int h = -1; if (q->which == Z_Query_type_1 || q->which == Z_Query_type_101) + { + Odr_int h = -1; h = get_term_hit(q->u.type_1->RPNStructure); - if (h == -1) - h = rand() % 24; - return h; + if (h == -1) + h = rand() % 24; + return h; + } + else + return 24; } /** \brief checks if it's a dummy Slow database