From 290a6721417f9de1c5c8bd854ecd562827729cd7 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 2 Sep 2023 15:23:52 -0400 Subject: [PATCH] Add test cases for fix-qpdf from pipe --- ChangeLog | 12 ++++++++++++ qpdf/qtest/fix-qdf.test | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8e2f42e6..2c2bb836 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2023-09-02 Jay Berkenbilt + + * Bug fix from M. Holger: allow fix-qdf to read from pipe. Fixes #1010. + + * Bug fix: maintain links to foreign pages when copying foreign + objects. This corrects a possible crash. + + * Add /MediaBox to a page if absent. Thanks M. Holger. + + * Use std::vector internally for Pl_Buffer to + avoid incompatibility with C++20. Thanks to Zoe Clifford. Fixes #1024. + 2023-07-09 Jay Berkenbilt * 11.5.0: release diff --git a/qpdf/qtest/fix-qdf.test b/qpdf/qtest/fix-qdf.test index e46ee9c1..96f42367 100644 --- a/qpdf/qtest/fix-qdf.test +++ b/qpdf/qtest/fix-qdf.test @@ -28,6 +28,27 @@ for (my $n = 1; $n <= 2; ++$n) {$td->FILE => "fix$n.qdf.out", $td->EXIT_STATUS => 0}); } +if (! (($^O eq 'MSWin32') || ($^O eq 'Win32') || ($^O eq 'msys'))) +{ + # The pipe tests are unstable on Windows. It has not been + # determined whether this is because the code doesn't work or the + # tests don't work, but as of September 2023, I think it works + # with MSVC and not with mingw. Fixing fix-qdf to read from pipes + # on Windows is not a high priority, but patches are welcome. + $n_tests += 4; + for (my $n = 1; $n <= 2; ++$n) + { + $td->runtest("fix-qdf $n from pipe", + {$td->COMMAND => "cat fix$n.qdf | fix-qdf "}, + {$td->FILE => "fix$n.qdf.out", + $td->EXIT_STATUS => 0}); + + $td->runtest("identity fix-qdf $n", + {$td->COMMAND => "fix-qdf fix$n.qdf.out"}, + {$td->FILE => "fix$n.qdf.out", + $td->EXIT_STATUS => 0}); +} + } $td->runtest("fix-qdf with big object stream", # > 255 objects in a stream {$td->COMMAND => "fix-qdf big-ostream.pdf"}, {$td->FILE => "big-ostream.pdf",