Bump year
[yazpp-moved-to-github.git] / src / tstquery.cpp
1 /* This file is part of the yazpp toolkit.
2  * Copyright (C) 1998-2013 Index Data and Mike Taylor
3  * See the file LICENSE for details.
4  */
5
6 #if HAVE_CONFIG_H
7 #include <config.h>
8 #endif
9 #include <stdlib.h>
10 #include <yazpp/z-query.h>
11
12 using namespace yazpp_1;
13
14 void tst1(const char *query_str_in, const char *query_expected)
15 {
16     Yaz_Z_Query q;
17
18     q = query_str_in;
19
20     Yaz_Z_Query q2;
21
22     q2 = q;
23
24     char query_str_out[100];
25     q2.print(query_str_out, sizeof(query_str_out)-1);
26
27     if (strcmp(query_str_out, query_expected))
28     {
29         fprintf(stderr, "tstquery: query mismatch out=%s expected=%s\n",
30                 query_str_out, query_expected);
31         exit(1);
32     }
33 }
34
35 int main(int argc, char **argv)
36 {
37     tst1("", "");
38     tst1("x", "RPN @attrset Bib-1 x");
39     tst1("@and a b", "RPN @attrset Bib-1 @and a b");
40 }
41
42 /*
43  * Local variables:
44  * c-basic-offset: 4
45  * c-file-style: "Stroustrup"
46  * indent-tabs-mode: nil
47  * End:
48  * vim: shiftwidth=4 tabstop=8 expandtab
49  */
50