From dcaa61d0a93b1b16b8ec552452ed0c4da2080c58 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 15 Jan 2013 12:46:43 +0100 Subject: [PATCH] Add test case for bad UTF-8 ISO2709 record --- test/xslt/Makefile.am | 2 ++ test/xslt/bad-utf8.mrc | 1 + test/xslt/dom-config-utf8.xml | 13 +++++++++++++ test/xslt/dom1.c | 3 +++ 4 files changed, 19 insertions(+) create mode 100644 test/xslt/bad-utf8.mrc create mode 100644 test/xslt/dom-config-utf8.xml diff --git a/test/xslt/Makefile.am b/test/xslt/Makefile.am index 052f1b6..f39e3ad 100644 --- a/test/xslt/Makefile.am +++ b/test/xslt/Makefile.am @@ -5,6 +5,7 @@ TESTS = $(check_PROGRAMS) EXTRA_DIST= \ dom-config-col.xml \ dom-config-marc.xml \ + dom-config-utf8.xml \ dom-config-one.xml \ dom-config-skipped.xml \ dom-index-element.xsl \ @@ -24,6 +25,7 @@ EXTRA_DIST= \ index.xsl \ marc-col.mrc \ marc-col.xml \ + bad-utf8.mrc \ marc-missing-ns.xml \ marc-one.xml \ marcschema-col.xml \ diff --git a/test/xslt/bad-utf8.mrc b/test/xslt/bad-utf8.mrc new file mode 100644 index 0000000..19369b0 --- /dev/null +++ b/test/xslt/bad-utf8.mrc @@ -0,0 +1 @@ +00491cz a2200133n 4500001001300000003000400013005001700017008004100034010003100075040002100106100002500127670011400152670009100266nb 9907124 DLC19990907125628.0990826n| acannaabn |n aaa c anb 9907124 z nr 99027159  aUkbengcUkdDLC10aBrown, Nigel,d1950- aLet the builder beware?, c1998:bt.p. (Nigel Brown) p.xi (partner, Manches & Co.) BL e-mail sent 17 Aug. 1999 aE-mail from company, 26 Aug. 1999b(Nigel Alexander Kirkwood Brown; born 21 Nov. 1950) \ No newline at end of file diff --git a/test/xslt/dom-config-utf8.xml b/test/xslt/dom-config-utf8.xml new file mode 100644 index 0000000..a74473e --- /dev/null +++ b/test/xslt/dom-config-utf8.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/test/xslt/dom1.c b/test/xslt/dom1.c index be4fe80..dd5f675 100644 --- a/test/xslt/dom1.c +++ b/test/xslt/dom1.c @@ -145,6 +145,9 @@ void tst(int argc, char **argv) zebra_close(zh); + /* testing indexing of bad UTF-8 encoded MARC record */ + zh = index_some(zs, "dom.dom-config-utf8.xml", "bad-utf8.mrc"); + zebra_close(zh); YAZ_CHECK(tl_close_down(0, zs)); } -- 1.7.10.4