aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf')
-rw-r--r--qpdf/qtest/qpdf.test8
-rw-r--r--qpdf/qtest/qpdf/test73.out2
-rw-r--r--qpdf/test_driver.cc5
3 files changed, 14 insertions, 1 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index 83cbacd3..2843adab 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -1215,7 +1215,13 @@ $td->runtest("check output",
show_ntests();
# ----------
$td->notify("--- Invalid objects ---");
-$n_tests += 2;
+$n_tests += 3;
+
+$td->runtest("closed input source",
+ {$td->COMMAND => "test_driver 73 minimal.pdf"},
+ {$td->FILE => "test73.out",
+ $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
$td->runtest("empty object",
{$td->COMMAND => "qpdf -show-object=7,0 empty-object.pdf"},
diff --git a/qpdf/qtest/qpdf/test73.out b/qpdf/qtest/qpdf/test73.out
new file mode 100644
index 00000000..1b7ad0e6
--- /dev/null
+++ b/qpdf/qtest/qpdf/test73.out
@@ -0,0 +1,2 @@
+WARNING: closed input source: object 2/0: error reading object: QPDF operation attempted after closing input source
+test 73 done
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index aef46d87..1be7fbaf 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -2300,6 +2300,11 @@ void runtest(int n, char const* filename1, char const* arg2)
buf->getSize());
assert(s.find("/bye") != std::string::npos);
}
+ else if (n == 73)
+ {
+ pdf.closeInputSource();
+ pdf.getRoot().getKey("/Pages").unparseResolved();
+ }
else
{
throw std::runtime_error(std::string("invalid test ") +