From be5342e415872d9f43511f7b68fbcec42dc2c0a7 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 11 Aug 2005 14:00:43 +0000 Subject: [PATCH] Added test for bad ODR nesting --- test/Makefile.am | 6 ++++-- test/tstodrstack.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 test/tstodrstack.c diff --git a/test/Makefile.am b/test/Makefile.am index c5c9ab8..686af4a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,9 +1,9 @@ ## Copyright (C) 1994-2004, Index Data ## All rights reserved. -## $Id: Makefile.am,v 1.6 2005-05-06 11:11:37 adam Exp $ +## $Id: Makefile.am,v 1.7 2005-08-11 14:00:43 adam Exp $ check_PROGRAMS = tsticonv tstnmem tstmatchstr tstwrbuf tstodr tstccl tstlog \ - tstsoap1 tstsoap2 + tstsoap1 tstsoap2 tstodrstack check_SCRIPTS = tstcql.sh tstmarc.sh TESTS = $(check_PROGRAMS) $(check_SCRIPTS) @@ -38,6 +38,8 @@ tstwrbuf_SOURCES = tstwrbuf.c tstodr_SOURCES = tstodrcodec.c tstodrcodec.h tstodr.c +tstodrstack_SOURCES = tstodrstack.c + tstccl_SOURCES = tstccl.c tstlog_SOURCES = tstlog.c diff --git a/test/tstodrstack.c b/test/tstodrstack.c new file mode 100644 index 0000000..8088c19 --- /dev/null +++ b/test/tstodrstack.c @@ -0,0 +1,34 @@ +#include +#include +#include + +void test1() +{ + ODR odr = odr_createmem(ODR_ENCODE); + YAZ_PQF_Parser parser = yaz_pqf_create(); + Z_RPNQuery *rpn_query; + + rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c"); + + if (!rpn_query) + exit(1); + rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure; + + z_RPNQuery(odr, &rpn_query, 0, 0); + + yaz_pqf_destroy(parser); + odr_destroy(odr); +} + +int main(int argc, char **argv) +{ + test1(); + exit(0); +} +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ -- 1.7.10.4