X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=6cc2bffefd4ea49a27fb4586ff94497e2ad0d155;hb=fe68107992cae293f6c2a3e2058ebfb5b09052a9;hp=4ebf1c1e6a10819d48cd0df7556723ca043682b8;hpb=6efe941c2ccde0e5a7895ab63d4b876fd6396bfc;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index 4ebf1c1..6cc2bff 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -21,6 +21,9 @@ #if HAVE_SYS_SELECT_H #include #endif +#ifdef WIN32 +#include +#endif #include #include @@ -130,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 @@ -284,7 +291,7 @@ int ztest_search(void *handle, bend_search_rr *rr) const char *name = names[i]; const char *value = values[i]; if (!strcmp(name, "seed")) - srandom(atoi(value)); + srand(atoi(value)); else if (!strcmp(name, "search-delay")) parse_delay(&new_set->search_delay, value); else if (!strcmp(name, "present-delay"))