aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2009-03-09 17:39:33 +0100
committerJay Berkenbilt <ejb@ql.org>2009-03-09 17:39:33 +0100
commit9ac249e7e7c3a6747d72e7c14682f6f295ec179b (patch)
tree369b592b7183eb2b24dffc6879218248440131c2
parentf62bec3ee53a377548ec197423efc20d4f4dc206 (diff)
downloadqpdf-9ac249e7e7c3a6747d72e7c14682f6f295ec179b.tar.zst
add damaged stream test case
git-svn-id: svn+q:///qpdf/trunk@664 71b93d88-0707-0410-a8cf-f5a4172ac649
-rw-r--r--qpdf/qtest/qpdf.test7
-rw-r--r--qpdf/qtest/qpdf/damaged-stream.out4
-rw-r--r--qpdf/qtest/qpdf/damaged-stream.pdfbin0 -> 77635 bytes
3 files changed, 10 insertions, 1 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index a3b5f176..7a8d0fb2 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -338,7 +338,7 @@ for (my $n = 16; $n <= 19; ++$n)
show_ntests();
# ----------
$td->notify("--- Specific File Tests ---");
-$n_tests += 2;
+$n_tests += 3;
$n_compare_pdfs += 1;
# Special PDF files that caused problems at some point
@@ -361,6 +361,11 @@ $td->runtest("convert to qdf",
compare_pdfs("old-and-complex.pdf", "a.qdf");
+$td->runtest("damaged stream",
+ {$td->COMMAND => "qpdf --check damaged-stream.pdf"},
+ {$td->FILE => "damaged-stream.out", $td->EXIT_STATUS => 3},
+ $td->NORMALIZE_NEWLINES);
+
show_ntests();
# ----------
$td->notify("--- Mutability Tests ---");
diff --git a/qpdf/qtest/qpdf/damaged-stream.out b/qpdf/qtest/qpdf/damaged-stream.out
new file mode 100644
index 00000000..a5ac0c4c
--- /dev/null
+++ b/qpdf/qtest/qpdf/damaged-stream.out
@@ -0,0 +1,4 @@
+checking damaged-stream.pdf
+File is not encrypted
+File is not linearized
+WARNING: damaged-stream.pdf: offset 426: error decoding stream data for object 5 0: LZWDecoder: bad code received
diff --git a/qpdf/qtest/qpdf/damaged-stream.pdf b/qpdf/qtest/qpdf/damaged-stream.pdf
new file mode 100644
index 00000000..32e7713f
--- /dev/null
+++ b/qpdf/qtest/qpdf/damaged-stream.pdf
Binary files differ