First use of unit test macros.
[yaz-moved-to-github.git] / test / tstxmlquery.c
1 /*
2  * Copyright (C) 1995-2005, Index Data ApS
3  * See the file LICENSE for details.
4  *
5  * $Id: tstxmlquery.c,v 1.1 2006-01-27 17:33:15 adam Exp $
6  */
7
8 #include <stdlib.h>
9 #include <stdio.h>
10
11 #include <yaz/wrbuf.h>
12 #include <yaz/xmlquery.h>
13 #include <yaz/pquery.h>
14 #include <yaz/test.h>
15
16 #if HAVE_XML2
17 static void pqf2xml_text(const char *pqf)
18 {
19     YAZ_PQF_Parser parser = yaz_pqf_create();
20     ODR odr = odr_createmem(ODR_ENCODE);
21     Z_RPNQuery *rpn;
22
23     YAZ_CHECK(parser);
24
25     YAZ_CHECK(odr);
26
27     rpn = yaz_pqf_parse(parser, odr, pqf);
28
29     YAZ_CHECK(rpn);
30
31     yaz_pqf_destroy(parser);
32
33     Z_Query *query = odr_malloc(odr, sizeof(*query));
34     query->which = Z_Query_type_1;
35     query->u.type_1 = rpn;
36
37     odr_destroy(odr);
38 }
39 #endif
40
41 int main (int argc, char **argv)
42 {
43     pqf2xml_text("@attr 1=4 computer");
44
45     exit(0);
46     return 0;
47 }
48
49 /*
50  * Local variables:
51  * c-basic-offset: 4
52  * indent-tabs-mode: nil
53  * End:
54  * vim: shiftwidth=4 tabstop=8 expandtab
55  */
56