2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-23 03:18:59 +00:00

Amend "recover file with xref stream" test

Change first xref stream dictionary to point to an invalid root in order
to detect failure to recover the last valid trailer.
This commit is contained in:
m-holger 2024-05-07 09:38:47 +01:00
parent 973edb4f2d
commit 065bb582a3
2 changed files with 3 additions and 2 deletions

View File

@ -102,10 +102,11 @@ $td->runtest("recover file with xref stream",
{$td->COMMAND => "qpdf --static-id --compress-streams=n" . {$td->COMMAND => "qpdf --static-id --compress-streams=n" .
" recover-xref-stream.pdf a.pdf"}, " recover-xref-stream.pdf a.pdf"},
{$td->FILE => "recover-xref-stream.out", $td->EXIT_STATUS => 3}, {$td->FILE => "recover-xref-stream.out", $td->EXIT_STATUS => 3},
$td->NORMALIZE_NEWLINES); $td->EXPECT_FAILURE);
$td->runtest("check file", $td->runtest("check file",
{$td->FILE => "a.pdf"}, {$td->FILE => "a.pdf"},
{$td->FILE => "recover-xref-stream-recovered.pdf"}); {$td->FILE => "recover-xref-stream-recovered.pdf"},
$td->EXPECT_FAILURE);
cleanup(); cleanup();
$td->report(calc_ntests($n_tests, $n_compare_pdfs)); $td->report(calc_ntests($n_tests, $n_compare_pdfs));