summaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/qpdf.test
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf/qtest/qpdf.test')
-rw-r--r--qpdf/qtest/qpdf.test44
1 files changed, 28 insertions, 16 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index 762c3fc5..b21ffcd6 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -1802,8 +1802,8 @@ foreach my $f (qw(screen print))
show_ntests();
# ----------
-$td->notify("--- Duplicated Page Object ---");
-$n_tests += 4;
+$td->notify("--- Page Tree Issues ---");
+$n_tests += 9;
$td->runtest("linearize duplicated pages",
{$td->COMMAND =>
@@ -1823,6 +1823,31 @@ $td->runtest("extract duplicated pages",
$td->runtest("compare files",
{$td->FILE => "a.pdf"},
{$td->FILE => "extract-duplicate-page.pdf"});
+$td->runtest("direct pages",
+ {$td->COMMAND =>
+ "qpdf --static-id direct-pages.pdf --pages . -- a.pdf"},
+ {$td->STRING => "", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+$td->runtest("check output",
+ {$td->FILE => "a.pdf"},
+ {$td->FILE => "direct-pages-fixed.pdf"});
+$td->runtest("show direct pages",
+ {$td->COMMAND =>
+ "qpdf --show-pages direct-pages.pdf"},
+ {$td->FILE => "direct-pages.out", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+
+# Json mode for direct and duplicated pages illustrates that the
+# "objects" section still shows the original objects before correction
+# but the "pages" section shows the pages with their new object
+# numbers.
+foreach my $f (qw(page_api_2 direct-pages))
+{
+ $td->runtest("json for $f",
+ {$td->COMMAND => "qpdf --json $f.pdf"},
+ {$td->FILE => "$f-json.out", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+}
show_ntests();
# ----------
@@ -2542,7 +2567,7 @@ for (my $n = 16; $n <= 19; ++$n)
show_ntests();
# ----------
$td->notify("--- Specific File Tests ---");
-$n_tests += 7;
+$n_tests += 4;
# Special PDF files that caused problems at some point
@@ -2563,19 +2588,6 @@ $td->runtest("compress objstm and xref",
$td->runtest("check output",
{$td->FILE => "a.pdf"},
{$td->FILE => "compress-objstm-xref.pdf"});
-$td->runtest("direct pages",
- {$td->COMMAND =>
- "qpdf --static-id direct-pages.pdf --pages . -- a.pdf"},
- {$td->STRING => "", $td->EXIT_STATUS => 0},
- $td->NORMALIZE_NEWLINES);
-$td->runtest("check output",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "direct-pages-fixed.pdf"});
-$td->runtest("show direct pages",
- {$td->COMMAND =>
- "qpdf --show-pages direct-pages.pdf"},
- {$td->FILE => "direct-pages.out", $td->EXIT_STATUS => 0},
- $td->NORMALIZE_NEWLINES);
show_ntests();
# ----------