From 6152d8cd8275e784278b6ccaf5f0fd3c240328b9 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 27 Sep 2012 15:11:49 +0200 Subject: [PATCH] Test new function ccl_qual_fitem2 --- test/test_ccl.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/test_ccl.c b/test/test_ccl.c index de611d3..427a3a6 100644 --- a/test/test_ccl.c +++ b/test/test_ccl.c @@ -455,6 +455,36 @@ void tst2(void) } +void tst_addinfo(void) +{ + const char *addinfo; + int r; + CCL_bibset bibset = ccl_qual_mk(); + + r = ccl_qual_fitem2(bibset, "u=4 s=pw t=l,r", "ti", &addinfo); + YAZ_CHECK(r == 0 && addinfo == 0); + + r = ccl_qual_fitem2(bibset, "1=1016 s=al,pw t=z", "term", &addinfo); + YAZ_CHECK(r == 0 && addinfo == 0); + + r = ccl_qual_fitem2(bibset, "x=", "term", &addinfo); + YAZ_CHECK(r != 0 && addinfo != 0); + + r = ccl_qual_fitem2(bibset, "12=3", "term", &addinfo); + YAZ_CHECK(r == 0 && addinfo == 0); + + r = ccl_qual_fitem2(bibset, "ab=3", "term", &addinfo); + YAZ_CHECK(r != 0 && addinfo != 0); + + r = ccl_qual_fitem2(bibset, "x=ab", "term", &addinfo); + YAZ_CHECK(r != 0 && addinfo != 0); + + r = ccl_qual_fitem2(bibset, "s=ab", "term", &addinfo); + YAZ_CHECK(r == 0 && addinfo == 0); + + ccl_qual_rm(&bibset); +} + int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); @@ -464,6 +494,7 @@ int main(int argc, char **argv) tst1(2); tst1(3); tst2(); + tst_addinfo(); YAZ_CHECK_TERM; } /* -- 1.7.10.4