X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=f27cb92f4bf44ff4debf2f38fb87c4dc52286769;hb=22a1022ca71a2b44b0f2e03dcf782be16375e0c1;hp=639783197f005427d7934de91d431407c842ffb7;hpb=b23a551976e442c5cbb0ee4aa46768904dd57ccf;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index 6397831..f27cb92 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -2,10 +2,13 @@ * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ - /** \file * \brief yaz-ztest Generic Frontend Server */ +#if HAVE_CONFIG_H +#include +#endif + #include #include @@ -210,8 +213,8 @@ static void ztest_sleep(double d) Sleep( (DWORD) (d * 1000)); #else struct timeval tv; - tv.tv_sec = floor(d); - tv.tv_usec = (d - floor(d)) * 1000000; + tv.tv_sec = d; + tv.tv_usec = (d - (long) d) * 1000000; select(0, 0, 0, 0, &tv); #endif } @@ -232,7 +235,7 @@ static void addterms(ODR odr, Z_FacetField *facet_field, const char *facet_name) int index; int freq = 100; int length = strlen(facet_name) + 10; - char key[length]; + char *key = odr_malloc(odr, length); key[0] = '\0'; for (index = 0; index < facet_field->num_terms; index++) { Z_Term *term; @@ -253,7 +256,7 @@ Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) { for (index = 0; index < facet_list->num; index++) { struct yaz_facet_attr attrvalues; yaz_facet_attr_init(&attrvalues); - attrvalues.limit = 10; + attrvalues.limit = 0; yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes, &attrvalues); yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit);