test/test_odrstack.c
void test2(void)
{
    ODR odr = odr_createmem(ODR_ENCODE);
    YAZ_PQF_Parser parser = yaz_pqf_create();
    Z_RPNQuery *rpn_query;
    int ret;

    YAZ_CHECK(odr);

    rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c");
    YAZ_CHECK(rpn_query);

    /* make the circular reference */
    rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure;

    ret = z_RPNQuery(odr, &rpn_query, 0, 0);  /* should fail */
    YAZ_CHECK(!ret);

    yaz_pqf_destroy(parser);
    odr_destroy(odr);
}
/** \brief build a circular referenced query */
\brief build a circular referenced query
\ brief build a circular referenced query
void test2(void)
{
    ODR odr = odr_createmem(ODR_ENCODE);
    YAZ_PQF_Parser parser = yaz_pqf_create();
    Z_RPNQuery *rpn_query;
    int ret;
    YAZ_CHECK(odr);
    rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c");
    YAZ_CHECK(rpn_query);
    rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure;
    ret = z_RPNQuery(odr, &rpn_query, 0, 0);  
    YAZ_CHECK(!ret);
    yaz_pqf_destroy(parser);
    odr_destroy(odr);
}
void test2 ( void ) { ODR odr = odr_createmem ( ODR_ENCODE ) ; YAZ_PQF_Parser parser = yaz_pqf_create ( ) ; Z_RPNQuery * rpn_query ; int ret ; YAZ_CHECK ( odr ) ; rpn_query = yaz_pqf_parse ( parser , odr , " " ) ; YAZ_CHECK ( rpn_query ) ; rpn_query -> RPNStructure -> u . complex -> s1 = rpn_query -> RPNStructure ; ret = z_RPNQuery ( odr , & rpn_query , 0 , 0 ) ; YAZ_CHECK ( ! ret ) ; yaz_pqf_destroy ( parser ) ; odr_destroy ( odr ) ; }
\brief build a circular referenced query
\ brief build a circular referenced query
/* make the circular reference */ /* should fail */