Added test for bad ODR nesting
[yaz-moved-to-github.git] / test / tstodrstack.c
1 #include <stdlib.h>
2 #include <yaz/pquery.h>
3 #include <yaz/proto.h>
4
5 void test1()
6 {
7     ODR odr = odr_createmem(ODR_ENCODE);
8     YAZ_PQF_Parser parser = yaz_pqf_create();
9     Z_RPNQuery *rpn_query;
10
11     rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c");
12
13     if (!rpn_query)
14         exit(1);
15     rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure;
16
17     z_RPNQuery(odr, &rpn_query, 0, 0);
18
19     yaz_pqf_destroy(parser);
20     odr_destroy(odr);
21 }
22
23 int main(int argc, char **argv)
24 {
25     test1();
26     exit(0);
27 }
28 /*
29  * Local variables:
30  * c-basic-offset: 4
31  * indent-tabs-mode: nil
32  * End:
33  * vim: shiftwidth=4 tabstop=8 expandtab
34  */