Add test case for bad UTF-8 ISO2709 record
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 15 Jan 2013 11:46:43 +0000 (12:46 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 15 Jan 2013 11:46:43 +0000 (12:46 +0100)
test/xslt/Makefile.am
test/xslt/bad-utf8.mrc [new file with mode: 0644]
test/xslt/dom-config-utf8.xml [new file with mode: 0644]
test/xslt/dom1.c

index 052f1b6..f39e3ad 100644 (file)
@@ -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 (file)
index 0000000..19369b0
--- /dev/null
@@ -0,0 +1 @@
+00491cz  a2200133n  4500001001300000003000400013005001700017008004100034010003100075040002100106100002500127670011400152670009100266\1enb 9907124 \1f\1eDLC\1e19990907125628.0\1e990826n| acannaabn          |n aaa     c\1e  \1fanb 9907124 \1fz nr 99027159 \1e  \1faUk\1fbeng\1fcUk\1fdDLC\1e10\1faBrown, Nigel,\1fd1950-\1e  \1faLet the builder beware?, c1998:\1fbt.p. (Nigel Brown) p.xi (partner, Manches & Co.) BL e-mail sent 17 Aug. 1999\1e  \1faE-mail from company, 26 Aug. 1999\1fb(Nigel Alexander Kirkwood Brown; born 21 Nov. 1950)\1e\1d
\ 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 (file)
index 0000000..a74473e
--- /dev/null
@@ -0,0 +1,13 @@
+<dom>
+  <extract name="index">
+      <xslt stylesheet="dom-index-element.xsl"/>
+  </extract>
+  <retrieve name="F">
+    <xslt stylesheet="id.xsl"/>
+  </retrieve>
+  <input syntax="xml">
+    <marc inputcharset="utf-8"/>
+  </input>
+</dom>
+
+   
index be4fe80..dd5f675 100644 (file)
@@ -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));
 }