Test case for YAZ-822
[yaz-moved-to-github.git] / test / test_ccl.c
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) Index Data
3  * See the file LICENSE for details.
4  */
5 #if HAVE_CONFIG_H
6 #include <config.h>
7 #endif
8
9 #include <string.h>
10 #include <yaz/ccl_xml.h>
11 #include <yaz/log.h>
12 #include <yaz/test.h>
13
14
15 static int tst_ccl_query(CCL_bibset bibset,
16                          const char *query,
17                          const char *result)
18 {
19     CCL_parser parser = ccl_parser_create(bibset);
20     int ret = 0;
21
22     if (parser && bibset)
23     {
24         struct ccl_rpn_node *rpn;
25
26         rpn = ccl_parser_find_str(parser, query);
27         if (rpn)
28         {
29             /* parse ok. check that result is there and match */
30             WRBUF wrbuf = wrbuf_alloc();
31             ccl_pquery(wrbuf, rpn);
32
33             /* check expect a result and that it matches */
34             if (result && !strcmp(wrbuf_cstr(wrbuf), result))
35                 ret = 1;
36             else
37             {
38                 yaz_log(YLOG_WARN, "%s: result does not match", query);
39                 yaz_log(YLOG_WARN, " expected %s", result);
40                 yaz_log(YLOG_WARN, " got      %s", wrbuf_cstr(wrbuf));
41                 ret = 0;
42             }
43             ccl_rpn_delete(rpn);
44             wrbuf_destroy(wrbuf);
45         }
46         else
47         {
48             if (result)
49             {
50                 yaz_log(YLOG_WARN, "%s: parse failed", query);
51                 ret = 0;
52             }
53             else
54                 ret = 1;
55         }
56     }
57     ccl_parser_destroy (parser);
58     return ret;
59 }
60
61 void tst1(int pass)
62 {
63     CCL_bibset bibset = ccl_qual_mk();
64     char tstline[128];
65
66     YAZ_CHECK(bibset);
67     if (!bibset)
68         return;
69
70     if (pass == 1)
71     {
72         CCL_bibset nbibset = ccl_qual_dup(bibset);
73         ccl_qual_rm(&bibset);
74         bibset = nbibset;
75     }
76
77     switch(pass)
78     {
79     case 0:
80         ccl_qual_fitem(bibset, "term dc.title", "comb");
81         ccl_qual_fitem(bibset, "u=4    s=pw t=l,r", "ti");
82         ccl_qual_fitem(bibset, "1=1016 s=al,pw t=r",    "term");
83         ccl_qual_fitem(bibset, "t=x", "reg");
84         ccl_qual_fitem(bibset, "t=z", "z");
85         ccl_qual_fitem(bibset, "1=/my/title",       "dc.title");
86         ccl_qual_fitem(bibset, "r=r,omiteq",        "date");
87         ccl_qual_fitem(bibset, "r=o",         "x");
88         ccl_qual_fitem(bibset, "dc.title", "title");
89         ccl_qual_fitem(bibset, "s=ag", "ag");
90         break;
91     case 1:
92         strcpy(tstline, "ti u=4    s=pw t=l,r");
93         ccl_qual_line(bibset, tstline);
94
95         strcpy(tstline, "term 1=1016 s=al,pw t=r  # default term");
96         ccl_qual_line(bibset, tstline);
97
98         strcpy(tstline, "reg t=x");
99         ccl_qual_line(bibset, tstline);
100
101         strcpy(tstline, "z t=z");
102         ccl_qual_line(bibset, tstline);
103
104         strcpy(tstline, "dc.title 1=/my/title");
105         ccl_qual_line(bibset, tstline);
106
107         strcpy(tstline, "date r=r,omiteq # ordered relation");
108         ccl_qual_line(bibset, tstline);
109
110         strcpy(tstline, "x r=o # ordered relation");
111         ccl_qual_line(bibset, tstline);
112
113         strcpy(tstline, "title dc.title # alias");
114         ccl_qual_line(bibset, tstline);
115
116         strcpy(tstline, "comb term dc.title # combination");
117         ccl_qual_line(bibset, tstline);
118
119         strcpy(tstline, "ag s=ag");
120         ccl_qual_line(bibset, tstline);
121         break;
122     case 2:
123         ccl_qual_buf(bibset, "ti u=4    s=pw t=l,r\n"
124                      "term 1=1016 s=al,pw t=r\r\n"
125                      "\n"
126                      "reg t=x\r\n"
127                      "z t=z\r\n"
128                      "dc.title 1=/my/title\n"
129                      "date r=r,omiteq\n"
130                      "x r=o\n"
131                      "title dc.title\n"
132                      "comb term dc.title\n"
133                      "ag s=ag\n"
134             );
135         break;
136     case 3:
137 #if YAZ_HAVE_XML2
138         if (1)
139         {
140             xmlDocPtr doc;
141             int r;
142             const char *addinfo = 0;
143             const char *xml_str =
144                 "<cclmap>\n"
145                 " <qual name=\"ti\">\n"
146                 "   <attr type=\"u\" value=\"4\"/>\n"
147                 "   <attr type=\"s\" value=\"pw\"/>\n"
148                 "   <attr type=\"t\" value=\"l,r\"/>\n"
149                 " </qual>\n"
150                 " <qual name=\"term\">\n"
151                 "   <attr type=\"1\" value=\"1016\"/>\n"
152                 "   <attr type=\"s\" value=\"al,pw\"/>\n"
153                 "   <attr type=\"t\" value=\"r\"/>\n"
154                 " </qual>\n"
155                 " <qual name=\"reg\">\n"
156                 "   <attr type=\"t\" value=\"x\"/>\n"
157                 " </qual>\n"
158                 " <qual name=\"z\">\n"
159                 "   <attr type=\"t\" value=\"z\"/>\n"
160                 " </qual>\n"
161                 " <qual name=\"dc.title\">\n"
162                 "   <attr type=\"1\" value=\"/my/title\"/>\n"
163                 " </qual>\n"
164                 " <qual name=\"date\">\n"
165                 "   <attr type=\"r\" value=\"r,omiteq\"/>\n"
166                 " </qual>\n"
167                 " <qual name=\"x\">\n"
168                 "   <attr type=\"r\" value=\"o\"/>\n"
169                 " </qual>\n"
170                 " <qual name=\"title\">\n"
171                 "   <qual name=\"dc.title\"/>\n"
172                 " </qual>\n"
173                 " <qual name=\"comb\">\n"
174                 "   <qual name=\"term\"/>\n"
175                 "   <qual name=\"dc.title\"/>\n"
176                 " </qual>\n"
177                 " <qual name=\"ag\">\n"
178                 "   <attr type=\"s\" value=\"ag\"/>\n"
179                 " </qual>\n"
180                 "</cclmap>\n";
181
182             doc = xmlParseMemory(xml_str, strlen(xml_str));
183             YAZ_CHECK(doc);
184
185             r = ccl_xml_config(bibset, xmlDocGetRootElement(doc), &addinfo);
186             YAZ_CHECK_EQ(r, 0);
187
188             xmlFreeDoc(doc);
189         }
190         break;
191 #else
192         return;
193 #endif
194     default:
195         YAZ_CHECK(0);
196         return;
197     }
198
199     YAZ_CHECK(tst_ccl_query(bibset, "x1", "@attr 4=2 @attr 1=1016 x1 "));
200
201     YAZ_CHECK(tst_ccl_query(bibset, "k\xc3\xb8" "benhavn", "@attr 4=2 @attr 1=1016 k\xc3\xb8" "benhavn "));
202
203     YAZ_CHECK(tst_ccl_query(bibset, "k\xf8" "benhavn", "@attr 4=2 @attr 1=1016 ""k\xf8" "benhavn "));
204
205     YAZ_CHECK(tst_ccl_query(bibset, "(((((x1)))))", "@attr 4=2 @attr 1=1016 x1 "));
206     YAZ_CHECK(tst_ccl_query(bibset, "x1 and x2",
207                   "@and "
208                   "@attr 4=2 @attr 1=1016 x1 "
209                   "@attr 4=2 @attr 1=1016 x2 "));
210     YAZ_CHECK(tst_ccl_query(bibset, "ti=x3", "@attr 4=2 @attr 1=4 x3 "));
211     YAZ_CHECK(tst_ccl_query(bibset, "dc.title=x4", "@attr 1=/my/title x4 "));
212     YAZ_CHECK(tst_ccl_query(bibset, "dc.title=(x4)", "@attr 1=/my/title x4 "));
213     YAZ_CHECK(tst_ccl_query(bibset, "x1 and", 0));
214     YAZ_CHECK(tst_ccl_query(bibset, "tix=x5", 0));
215
216     YAZ_CHECK(tst_ccl_query(bibset, "a%b",
217                   "@prox 0 1 0 2 k 2 "
218                   "@attr 4=2 @attr 1=1016 a "
219                   "@attr 4=2 @attr 1=1016 b "));
220     YAZ_CHECK(tst_ccl_query(bibset, "a%(b)",
221                   "@prox 0 1 0 2 k 2 "
222                   "@attr 4=2 @attr 1=1016 a "
223                   "@attr 4=2 @attr 1=1016 b "));
224     YAZ_CHECK(tst_ccl_query(bibset, "(a)%(b)",
225                   "@prox 0 1 0 2 k 2 "
226                   "@attr 4=2 @attr 1=1016 a "
227                   "@attr 4=2 @attr 1=1016 b "));
228     YAZ_CHECK(tst_ccl_query(bibset, "a%1b",
229                   "@prox 0 1 0 2 k 2 "
230                   "@attr 4=2 @attr 1=1016 a "
231                   "@attr 4=2 @attr 1=1016 b "));
232
233     YAZ_CHECK(tst_ccl_query(bibset, "a%2b",
234                   "@prox 0 2 0 2 k 2 "
235                   "@attr 4=2 @attr 1=1016 a "
236                   "@attr 4=2 @attr 1=1016 b "));
237
238     YAZ_CHECK(tst_ccl_query(bibset, "(a)%2(b)",
239                   "@prox 0 2 0 2 k 2 "
240                   "@attr 4=2 @attr 1=1016 a "
241                   "@attr 4=2 @attr 1=1016 b "));
242
243     YAZ_CHECK(tst_ccl_query(bibset, "a%19b",
244                   "@prox 0 19 0 2 k 2 "
245                   "@attr 4=2 @attr 1=1016 a "
246                   "@attr 4=2 @attr 1=1016 b "));
247
248     YAZ_CHECK(tst_ccl_query(bibset, "spid%æserne",
249                   "@prox 0 1 0 2 k 2 "
250                   "@attr 4=2 @attr 1=1016 spid "
251                   "@attr 4=2 @attr 1=1016 Ã¦serne "));
252
253     YAZ_CHECK(tst_ccl_query(bibset, "a!b",
254                   "@prox 0 1 1 2 k 2 "
255                   "@attr 4=2 @attr 1=1016 a "
256                   "@attr 4=2 @attr 1=1016 b "));
257     YAZ_CHECK(tst_ccl_query(bibset, "a!2b",
258                   "@prox 0 2 1 2 k 2 "
259                   "@attr 4=2 @attr 1=1016 a "
260                   "@attr 4=2 @attr 1=1016 b "));
261
262     YAZ_CHECK(tst_ccl_query(bibset, "a% (b or dc.title=c)",
263                             "@prox 0 1 0 2 k 2 "
264                             "@attr 4=2 @attr 1=1016 a "
265                             "@or @attr 4=2 @attr 1=1016 b "
266 #if YAZ_781
267                             "@or @attr 4=2 @attr 1=/my/title c "
268                             "@attr 4=2 @attr 1=1016 c "
269 #else
270                             "@attr 4=2 @attr 1=1016 @attr 1=/my/title c "
271 #endif
272     ));
273
274     YAZ_CHECK(tst_ccl_query(bibset, "(a b) % (c)",
275                             "@prox 0 1 0 2 k 2 @and "
276                             "@attr 4=2 @attr 1=1016 a @attr 4=2 @attr 1=1016 b "
277                             "@attr 4=2 @attr 1=1016 c " ));
278
279     YAZ_CHECK(tst_ccl_query(bibset, "date=1980",
280                             "1980 "));
281     YAZ_CHECK(tst_ccl_query(bibset, "(date=1980)",
282                             "1980 "));
283     YAZ_CHECK(tst_ccl_query(bibset, "date>1980",
284                             "@attr 2=5 1980 "));
285     YAZ_CHECK(tst_ccl_query(bibset, "date>=1980",
286                             "@attr 2=4 1980 "));
287     YAZ_CHECK(tst_ccl_query(bibset, "date<1980",
288                             "@attr 2=1 1980 "));
289     YAZ_CHECK(tst_ccl_query(bibset, "date<=1980",
290                             "@attr 2=2 1980 "));
291     YAZ_CHECK(tst_ccl_query(bibset, "date=234-1990",
292                             "@and @attr 2=4 234 @attr 2=2 1990 "));
293     YAZ_CHECK(tst_ccl_query(bibset, "date=234- 1990",
294                             "@and @attr 2=4 234 @attr 2=2 1990 "));
295     YAZ_CHECK(tst_ccl_query(bibset, "date=234 -1990",
296                             "@and @attr 2=4 234 @attr 2=2 1990 "));
297     YAZ_CHECK(tst_ccl_query(bibset, "date=234 - 1990",
298                             "@and @attr 2=4 234 @attr 2=2 1990 "));
299     YAZ_CHECK(tst_ccl_query(bibset, "date=-1980",
300                             "@attr 2=2 1980 "));
301     YAZ_CHECK(tst_ccl_query(bibset, "date=- 1980",
302                             "@attr 2=2 1980 "));
303     YAZ_CHECK(tst_ccl_query(bibset, "x=-1980",
304                             "@attr 2=3 -1980 "));
305     YAZ_CHECK(tst_ccl_query(bibset, "x=- 1980",
306                             "@attr 2=2 1980 "));
307     YAZ_CHECK(tst_ccl_query(bibset, "x= -1980",
308                             "@attr 2=3 -1980 "));
309     YAZ_CHECK(tst_ccl_query(bibset, "x=234-1990",
310                             "@attr 2=3 234-1990 "));
311     YAZ_CHECK(tst_ccl_query(bibset, "x=234 - 1990",
312                             "@and @attr 2=4 234 @attr 2=2 1990 "));
313     YAZ_CHECK(tst_ccl_query(bibset, "ti=a,b",
314                             "@attr 4=1 @attr 1=4 a,b "));
315     YAZ_CHECK(tst_ccl_query(bibset, "ti=a, b",
316                             "@attr 4=1 @attr 1=4 \"a, b\" "));
317     YAZ_CHECK(tst_ccl_query(bibset, "ti=a-b",
318                             "@attr 4=2 @attr 1=4 a-b "));
319     YAZ_CHECK(tst_ccl_query(bibset, "ti=a - b",
320                             "@attr 4=1 @attr 1=4 \"a - b\" "));
321
322     YAZ_CHECK(tst_ccl_query(bibset, "a?",
323                             "@attr 5=1 @attr 4=2 @attr 1=1016 a "));
324     YAZ_CHECK(tst_ccl_query(bibset, "a b",
325                             "@and @attr 4=2 @attr 1=1016 a "
326                             "@attr 4=2 @attr 1=1016 b "));
327
328     YAZ_CHECK(tst_ccl_query(bibset, "a b?",
329                             "@and @attr 4=2 @attr 1=1016 a "
330                             "@attr 5=1 @attr 4=2 @attr 1=1016 b "));
331
332     YAZ_CHECK(tst_ccl_query(bibset, "title=a",
333                             "@attr 1=/my/title a "));
334
335     YAZ_CHECK(tst_ccl_query(bibset, "reg=a?b#\"c?\"",
336                             "@attr 5=102 a.*b.c\\\\? "));
337     YAZ_CHECK(tst_ccl_query(bibset, "z=a?b#\"c?\"",
338                             "@attr 5=104 a?b#c\\\\? "));
339
340     YAZ_CHECK(tst_ccl_query(bibset, "reg=\\(",
341                             "( "));
342     YAZ_CHECK(tst_ccl_query(bibset, "z=\\(",
343                             "( "));
344
345     YAZ_CHECK(tst_ccl_query(bibset, "z=a b#",
346                             "@attr 5=104 \"a b#\" "));
347
348     YAZ_CHECK(tst_ccl_query(bibset, "reg=\\\"",
349                             "\"\\\"\" "));
350     YAZ_CHECK(tst_ccl_query(bibset, "z=\\\"",
351                             "\"\\\"\" "));
352
353     YAZ_CHECK(tst_ccl_query(bibset, "reg=.",
354                             ". "));
355     YAZ_CHECK(tst_ccl_query(bibset, "z=.",
356                             ". "));
357
358     YAZ_CHECK(tst_ccl_query(bibset, "reg=\".\"",
359                             ". "));
360     YAZ_CHECK(tst_ccl_query(bibset, "z=\".\"",
361                             ". "));
362
363     YAZ_CHECK(tst_ccl_query(bibset, "reg=?\\?",
364                             "@attr 5=102 .*\\\\? "));
365     YAZ_CHECK(tst_ccl_query(bibset, "z=?\\?",
366                             "@attr 5=104 ?\\\\? "));
367
368     YAZ_CHECK(tst_ccl_query(bibset, "reg=\"?\\?\"",
369                             "?? "));
370     YAZ_CHECK(tst_ccl_query(bibset, "z=\"?\\?\"",
371                             "?? "));
372
373     YAZ_CHECK(tst_ccl_query(bibset, "reg=\\\\",
374                             "\\\\ "));
375     YAZ_CHECK(tst_ccl_query(bibset, "z=\\\\",
376                             "\\\\ "));
377
378     YAZ_CHECK(tst_ccl_query(bibset, "\\\\",
379                             "@attr 4=2 @attr 1=1016 \\\\ "));
380
381     YAZ_CHECK(tst_ccl_query(bibset, "comb=a",
382                             "@or @attr 4=2 @attr 1=1016 a "
383                             "@attr 1=/my/title a "));
384
385     YAZ_CHECK(tst_ccl_query(bibset, "a? b?",
386                             "@and @attr 5=1 @attr 4=2 @attr 1=1016 a "
387                             "@attr 5=1 @attr 4=2 @attr 1=1016 b "));
388
389     YAZ_CHECK(tst_ccl_query(bibset, "\"a\"? \"b?\"",
390                             "@and @attr 5=1 @attr 4=2 @attr 1=1016 a "
391                             "@attr 4=2 @attr 1=1016 b? "));
392
393     YAZ_CHECK(tst_ccl_query(bibset, "@and",
394                             "@attr 4=2 @attr 1=1016 \\@and "));
395
396     YAZ_CHECK(tst_ccl_query(bibset, "a@and",
397                             "@attr 4=2 @attr 1=1016 a@and "));
398
399     YAZ_CHECK(tst_ccl_query(bibset, "}",
400                             "@attr 4=2 @attr 1=1016 } "));
401
402     YAZ_CHECK(tst_ccl_query(bibset, "{",
403                             "@attr 4=2 @attr 1=1016 \"{\" "));
404
405     YAZ_CHECK(tst_ccl_query(bibset, "\"a b c\"",
406                             "@attr 4=1 @attr 1=1016 \"a b c\" "));
407
408     YAZ_CHECK(tst_ccl_query(bibset, "\"a b  c  \"",
409                             "@attr 4=1 @attr 1=1016 \"a b  c  \" "));
410
411     YAZ_CHECK(tst_ccl_query(bibset, "ag=a",
412                             "@attr 4=2 a "));
413
414     YAZ_CHECK(tst_ccl_query(bibset, "ag=a b",
415                             "@attr 4=2 \"a b\" "));
416
417     YAZ_CHECK(tst_ccl_query(bibset, "ag=a b \"c d\"",
418                             "@and @attr 4=2 \"a b\" @attr 4=1 \"c d\" "));
419
420     YAZ_CHECK(tst_ccl_query(bibset, "ag=a b \"c\"",
421                             "@attr 4=2 \"a b c\" "));
422
423     YAZ_CHECK(tst_ccl_query(bibset, "ag=a b \"\"",
424                             "@attr 4=2 \"a b \" "));
425
426     YAZ_CHECK(tst_ccl_query(bibset, "ag=a \"b c\" d",
427                             "@and @and "
428                             "@attr 4=2 a @attr 4=1 \"b c\" @attr 4=2 d "));
429
430     YAZ_CHECK(tst_ccl_query(bibset, "ag=\"a b c\"",
431                             "@attr 4=1 \"a b c\" "));
432
433     YAZ_CHECK(tst_ccl_query(bibset, "ag=\"a b c\" \"d e\"",
434                             "@and @attr 4=1 \"a b c\" @attr 4=1 \"d e\" "));
435     ccl_qual_rm(&bibset);
436 }
437
438 void tst2(void)
439 {
440     CCL_bibset bibset = ccl_qual_mk();
441
442     YAZ_CHECK(bibset);
443     if (!bibset)
444         return;
445
446     ccl_qual_fitem(bibset, "u=4    s=pw t=l,r", "ti");
447     ccl_qual_fitem(bibset, "1=1016 s=al,pw t=z",    "term");
448
449     YAZ_CHECK(tst_ccl_query(bibset, "a?#",
450                             "@attr 5=104 @attr 4=2 @attr 1=1016 a?# "));
451
452     YAZ_CHECK(tst_ccl_query(bibset, "a b?#",
453                             "@and @attr 4=2 @attr 1=1016 a @attr 5=104 @attr 4=2 @attr 1=1016 b?# "));
454
455     YAZ_CHECK(tst_ccl_query(bibset, "a*",
456                             "@attr 4=2 @attr 1=1016 a* "));
457
458     YAZ_CHECK(tst_ccl_query(bibset, "a?",
459                             "@attr 5=104 @attr 4=2 @attr 1=1016 a? "));
460
461     ccl_qual_fitem(bibset, "*", "@truncation");
462     YAZ_CHECK(tst_ccl_query(bibset, "a*",
463                             "@attr 5=104 @attr 4=2 @attr 1=1016 a? "));
464
465     YAZ_CHECK(tst_ccl_query(bibset, "a?",
466                             "@attr 4=2 @attr 1=1016 a? "));
467
468     ccl_qual_fitem(bibset, "?", "@mask");
469     YAZ_CHECK(tst_ccl_query(bibset, "a?",
470                             "@attr 5=104 @attr 4=2 @attr 1=1016 a# "));
471
472
473     ccl_qual_fitem(bibset, "", "@mask");
474     ccl_qual_fitem(bibset, "", "@truncation");
475     YAZ_CHECK(tst_ccl_query(bibset, "a?#",
476                             "@attr 4=2 @attr 1=1016 a?# "));
477
478     ccl_qual_fitem(bibset, "og", "@and");
479     ccl_qual_fitem(bibset, "eller", "@or");
480     ccl_qual_fitem(bibset, "ikke", "@not");
481
482     YAZ_CHECK(tst_ccl_query(bibset, "a og b eller c ikke d",
483                             "@not @or @and @attr 4=2 @attr 1=1016 a "
484                             "@attr 4=2 @attr 1=1016 b "
485                             "@attr 4=2 @attr 1=1016 c "
486                             "@attr 4=2 @attr 1=1016 d "));
487     ccl_qual_rm(&bibset);
488 }
489
490
491 void tst_addinfo(void)
492 {
493     const char *addinfo;
494     int r;
495     CCL_bibset bibset = ccl_qual_mk();
496
497     r = ccl_qual_fitem2(bibset, "u=4    s=pw t=l,r", "ti", &addinfo);
498     YAZ_CHECK(r == 0 && addinfo == 0);
499
500     r = ccl_qual_fitem2(bibset, "1=1016 s=al,pw t=z", "term", &addinfo);
501     YAZ_CHECK(r == 0 && addinfo == 0);
502
503     r = ccl_qual_fitem2(bibset, "x=", "term", &addinfo);
504     YAZ_CHECK(r != 0 && addinfo != 0);
505
506     r = ccl_qual_fitem2(bibset, "12=3", "term", &addinfo);
507     YAZ_CHECK(r == 0 && addinfo == 0);
508
509     r = ccl_qual_fitem2(bibset, "ab=3", "term", &addinfo);
510     YAZ_CHECK(r != 0 && addinfo != 0);
511
512     r = ccl_qual_fitem2(bibset, "x=ab", "term", &addinfo);
513     YAZ_CHECK(r != 0 && addinfo != 0);
514
515     r = ccl_qual_fitem2(bibset, "s=ab", "term", &addinfo);
516     YAZ_CHECK(r == 0 && addinfo == 0);
517
518     ccl_qual_rm(&bibset);
519 }
520
521 int main(int argc, char **argv)
522 {
523     YAZ_CHECK_INIT(argc, argv);
524     YAZ_CHECK_LOG();
525     tst1(0);
526     tst1(1);
527     tst1(2);
528     tst1(3);
529     tst2();
530     tst_addinfo();
531     YAZ_CHECK_TERM;
532 }
533 /*
534  * Local variables:
535  * c-basic-offset: 4
536  * c-file-style: "Stroustrup"
537  * indent-tabs-mode: nil
538  * End:
539  * vim: shiftwidth=4 tabstop=8 expandtab
540  */
541