X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=test%2Fapi%2Ftest_insert_fetch.c;h=be6b85a3b69d8c8b72b57d2940bac1a3972d3196;hp=4bab5e16d3286d893def6e685eaace80dc120502;hb=HEAD;hpb=a030c87bc444608639905eca95e29f84a4f1d991 diff --git a/test/api/test_insert_fetch.c b/test/api/test_insert_fetch.c index 4bab5e1..be6b85a 100644 --- a/test/api/test_insert_fetch.c +++ b/test/api/test_insert_fetch.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2011 Index Data + Copyright (C) Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -19,6 +19,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA /* insert a small pile of records, search and fetch them */ +#if HAVE_CONFIG_H +#include +#endif #include "testlib.h" const char *myrec[] = { @@ -26,7 +29,7 @@ const char *myrec[] = { " My title\n" "\n", 0}; - + #define NUMBER_TO_FETCH_MAX 1000 static void tst(int argc, char **argv) @@ -62,12 +65,12 @@ static void tst(int argc, char **argv) ZebraRetrievalRecord retrievalRecord[NUMBER_TO_FETCH_MAX]; char setname[20]; int j; - ODR odr_input = odr_createmem(ODR_DECODE); - ODR odr_output = odr_createmem(ODR_DECODE); + ODR odr_input = odr_createmem(ODR_DECODE); + ODR odr_output = odr_createmem(ODR_DECODE); YAZ_PQF_Parser parser = yaz_pqf_create(); Z_RPNQuery *query = yaz_pqf_parse(parser, odr_input, "@attr 1=4 my"); zint hits; - + sprintf(setname, "s%d", i+1); ret = zebra_search_RPN(zh, odr_input, query, setname, &hits); if (ret != ZEBRA_OK) @@ -78,7 +81,7 @@ static void tst(int argc, char **argv) } if (hits != number_to_be_inserted) { - yaz_log(YLOG_WARN, "Unexpected hit count " ZINT_FORMAT + yaz_log(YLOG_WARN, "Unexpected hit count " ZINT_FORMAT "(should be %d)", hits, number_to_be_inserted); exit(1); } @@ -102,7 +105,7 @@ static void tst(int argc, char **argv) code); exit(1); } - + for (j = 0; j < number_to_fetch; j++) { if (!retrievalRecord[j].buf)