X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoomtst7.c;h=515c06223af1f5d9d761fd010a35da2f2a28b317;hb=35d8c5921e8b1cd89e52aa6bf71e0a9bf6e3471a;hp=2a6085f30798bc2bb78aef2c1c54764efbf5ab4f;hpb=13671e7cc0f3dd4e4b02f94d64a50778c5696ba6;p=yaz-moved-to-github.git diff --git a/zoom/zoomtst7.c b/zoom/zoomtst7.c index 2a6085f..515c062 100644 --- a/zoom/zoomtst7.c +++ b/zoom/zoomtst7.c @@ -1,5 +1,5 @@ /* - * $Id: zoomtst7.c,v 1.7 2001-11-18 21:14:23 adam Exp $ + * $Id: zoomtst7.c,v 1.12 2002-09-24 08:00:50 adam Exp $ * * API test.. */ @@ -10,12 +10,13 @@ #include #include - +#include #include int main(int argc, char **argv) { - int i, j, block; + int block; + size_t j, i; ZOOM_connection z; ZOOM_resultset r[10]; /* and result sets .. */ ZOOM_options o; @@ -51,6 +52,7 @@ int main(int argc, char **argv) for (i = 0; i<10; i++) { char host[40]; + printf ("session %2d", i); sprintf (host, "localhost:9999/%d", i); z = ZOOM_connection_create (o); @@ -91,7 +93,7 @@ int main(int argc, char **argv) ZOOM_query_destroy (s); - putchar ('.'); + printf ("."); if (block > 0) while (ZOOM_event (1, &z)) ; @@ -102,8 +104,9 @@ int main(int argc, char **argv) for (; j < 10; j++) ZOOM_resultset_destroy (r[j]); printf ("10 searches, 20 presents done\n"); + } - + for (i = 0; i<1; i++) { ZOOM_query q = ZOOM_query_create (); @@ -124,30 +127,59 @@ int main(int argc, char **argv) r[j] = ZOOM_connection_search_pqf (z, query); - putchar ('.'); + printf ("."); if (block > 0) while (ZOOM_event (1, &z)) ; } + ZOOM_connection_destroy (z); for (j = 0; j < 10; j++) { ZOOM_resultset_records (r[j], 0, 0, 1); - if (block > 0) - while (ZOOM_event (1, &z)) - ; } for (j = 0; j < 10; j++) ZOOM_resultset_destroy (r[j]); ZOOM_query_destroy (q); printf ("10 searches, 10 ignored presents done\n"); } + + + for (i = 0; i<1; i++) + { + char host[40]; + ZOOM_scanset scan = 0; + + printf ("session %2d", i); + sprintf (host, "localhost:9999/%d", i); + z = ZOOM_connection_create (o); + ZOOM_connection_connect (z, host, 0); + + scan = ZOOM_connection_scan (z, "@attr 1=4 a"); + if (block > 0) + while (ZOOM_event (1, &z)) + ; + printf (" scan size = %d\n", ZOOM_scanset_size(scan)); + for (j = 0; j