Commit 321f9e79db85fe67a3cc498780dbe88602483b16
1 parent
647b9831
Fix tests with deterministic IDs
Showing
5 changed files
with
17 additions
and
16 deletions
qpdf/qtest/error-condition.test
| @@ -194,8 +194,8 @@ $td->runtest("xref loop with append", | @@ -194,8 +194,8 @@ $td->runtest("xref loop with append", | ||
| 194 | $td->EXIT_STATUS => 3}, | 194 | $td->EXIT_STATUS => 3}, |
| 195 | $td->NORMALIZE_NEWLINES); | 195 | $td->NORMALIZE_NEWLINES); |
| 196 | $td->runtest("check output", | 196 | $td->runtest("check output", |
| 197 | - {$td->FILE => "a.pdf"}, | ||
| 198 | - {$td->FILE => "append-xref-loop-fixed.pdf"}); | 197 | + {$td->COMMAND => "qpdf-test-compare a.pdf append-xref-loop-fixed.pdf"}, |
| 198 | + {$td->FILE => "append-xref-loop-fixed.pdf", $td->EXIT_STATUS => 0}); | ||
| 199 | 199 | ||
| 200 | $td->runtest("endobj not at newline", | 200 | $td->runtest("endobj not at newline", |
| 201 | {$td->COMMAND => | 201 | {$td->COMMAND => |
| @@ -204,8 +204,8 @@ $td->runtest("endobj not at newline", | @@ -204,8 +204,8 @@ $td->runtest("endobj not at newline", | ||
| 204 | $td->EXIT_STATUS => 3}, | 204 | $td->EXIT_STATUS => 3}, |
| 205 | $td->NORMALIZE_NEWLINES); | 205 | $td->NORMALIZE_NEWLINES); |
| 206 | $td->runtest("check output", | 206 | $td->runtest("check output", |
| 207 | - {$td->FILE => "a.pdf"}, | ||
| 208 | - {$td->FILE => "endobj-at-eol-fixed.pdf"}); | 207 | + {$td->COMMAND => "qpdf-test-compare a.pdf endobj-at-eol-fixed.pdf"}, |
| 208 | + {$td->FILE => "endobj-at-eol-fixed.pdf", $td->EXIT_STATUS => 0}); | ||
| 209 | 209 | ||
| 210 | cleanup(); | 210 | cleanup(); |
| 211 | $td->report($n_tests); | 211 | $td->report($n_tests); |
qpdf/qtest/form-xobject.test
| @@ -94,8 +94,8 @@ $td->runtest("overlay on page with no resources", | @@ -94,8 +94,8 @@ $td->runtest("overlay on page with no resources", | ||
| 94 | {$td->STRING => "", $td->EXIT_STATUS => 0}, | 94 | {$td->STRING => "", $td->EXIT_STATUS => 0}, |
| 95 | $td->NORMALIZE_NEWLINES); | 95 | $td->NORMALIZE_NEWLINES); |
| 96 | $td->runtest("check overlay with no resources output", | 96 | $td->runtest("check overlay with no resources output", |
| 97 | - {$td->FILE => "a.pdf"}, | ||
| 98 | - {$td->FILE => "overlay-no-resources.pdf"}); | 97 | + {$td->COMMAND => "qpdf-test-compare a.pdf overlay-no-resources.pdf"}, |
| 98 | + {$td->FILE => "overlay-no-resources.pdf", $td->EXIT_STATUS => 0}); | ||
| 99 | 99 | ||
| 100 | cleanup(); | 100 | cleanup(); |
| 101 | $td->report($n_tests); | 101 | $td->report($n_tests); |
qpdf/qtest/many-nulls.test
| @@ -23,9 +23,8 @@ $td->runtest("create file with many nulls", | @@ -23,9 +23,8 @@ $td->runtest("create file with many nulls", | ||
| 23 | {$td->STRING => "", $td->EXIT_STATUS => 0}, | 23 | {$td->STRING => "", $td->EXIT_STATUS => 0}, |
| 24 | $td->NORMALIZE_NEWLINES); | 24 | $td->NORMALIZE_NEWLINES); |
| 25 | $td->runtest("compare output", | 25 | $td->runtest("compare output", |
| 26 | - {$td->FILE => "a.pdf"}, | ||
| 27 | - {$td->FILE => "many-nulls.pdf"}, | ||
| 28 | - $td->NORMALIZE_NEWLINES); | 26 | + {$td->COMMAND => "qpdf-test-compare a.pdf many-nulls.pdf"}, |
| 27 | + {$td->FILE => "many-nulls.pdf", $td->EXIT_STATUS => 0}); | ||
| 29 | $td->runtest("run check file", | 28 | $td->runtest("run check file", |
| 30 | {$td->COMMAND => "qpdf --check a.pdf"}, | 29 | {$td->COMMAND => "qpdf --check a.pdf"}, |
| 31 | {$td->FILE => "many-nulls.out", $td->EXIT_STATUS => 0}, | 30 | {$td->FILE => "many-nulls.out", $td->EXIT_STATUS => 0}, |
qpdf/qtest/replace-input.test
| @@ -32,10 +32,12 @@ foreach my $d (['auto-ü', 1], ['auto-öπ', 2]) | @@ -32,10 +32,12 @@ foreach my $d (['auto-ü', 1], ['auto-öπ', 2]) | ||
| 32 | " --object-streams=generate --replace-input ./$u.pdf"}, | 32 | " --object-streams=generate --replace-input ./$u.pdf"}, |
| 33 | {$td->STRING => "", $td->EXIT_STATUS => 0}, | 33 | {$td->STRING => "", $td->EXIT_STATUS => 0}, |
| 34 | $td->NORMALIZE_NEWLINES); | 34 | $td->NORMALIZE_NEWLINES); |
| 35 | + # qpdf handles Unicode filenames on Windows, but qpdf-test-compare | ||
| 36 | + # doesn't. | ||
| 37 | + rename("$u.pdf", "u.pdf") or die; | ||
| 35 | $td->runtest("check output ($u)", | 38 | $td->runtest("check output ($u)", |
| 36 | - {$td->FILE => "$u.pdf"}, | ||
| 37 | - {$td->FILE => "replace-input.pdf"}, | ||
| 38 | - $td->NORMALIZE_NEWLINES); | 39 | + {$td->COMMAND => "qpdf-test-compare u.pdf replace-input.pdf"}, |
| 40 | + {$td->FILE => "replace-input.pdf", $td->EXIT_STATUS => 0}); | ||
| 39 | } | 41 | } |
| 40 | 42 | ||
| 41 | system("cp xref-with-short-size.pdf auto-warn.pdf") == 0 or die; | 43 | system("cp xref-with-short-size.pdf auto-warn.pdf") == 0 or die; |
| @@ -46,8 +48,8 @@ $td->runtest("replace input with warnings", | @@ -46,8 +48,8 @@ $td->runtest("replace input with warnings", | ||
| 46 | $td->NORMALIZE_NEWLINES); | 48 | $td->NORMALIZE_NEWLINES); |
| 47 | 49 | ||
| 48 | $td->runtest("check output", | 50 | $td->runtest("check output", |
| 49 | - {$td->FILE => "auto-warn.pdf"}, | ||
| 50 | - {$td->FILE => "warn-replace.pdf"}); | 51 | + {$td->COMMAND => "qpdf-test-compare auto-warn.pdf warn-replace.pdf"}, |
| 52 | + {$td->FILE => "warn-replace.pdf", $td->EXIT_STATUS => 0}); | ||
| 51 | $td->runtest("check orig output", | 53 | $td->runtest("check orig output", |
| 52 | {$td->FILE => "auto-warn.pdf.~qpdf-orig"}, | 54 | {$td->FILE => "auto-warn.pdf.~qpdf-orig"}, |
| 53 | {$td->FILE => "xref-with-short-size.pdf"}); | 55 | {$td->FILE => "xref-with-short-size.pdf"}); |
qpdf/qtest/type-checks.test
| @@ -27,8 +27,8 @@ $td->runtest("ensure object-types-os is up-to-date", | @@ -27,8 +27,8 @@ $td->runtest("ensure object-types-os is up-to-date", | ||
| 27 | " object-types.pdf a.pdf"}, | 27 | " object-types.pdf a.pdf"}, |
| 28 | {$td->STRING => "", $td->EXIT_STATUS => 0}); | 28 | {$td->STRING => "", $td->EXIT_STATUS => 0}); |
| 29 | $td->runtest("check file", | 29 | $td->runtest("check file", |
| 30 | - {$td->FILE => "a.pdf"}, | ||
| 31 | - {$td->FILE => "object-types-os.pdf"}); | 30 | + {$td->COMMAND => "qpdf-test-compare a.pdf object-types-os.pdf"}, |
| 31 | + {$td->FILE => "object-types-os.pdf", $td->EXIT_STATUS => 0}); | ||
| 32 | $td->runtest("type checks", | 32 | $td->runtest("type checks", |
| 33 | {$td->COMMAND => "test_driver 42 object-types.pdf"}, | 33 | {$td->COMMAND => "test_driver 42 object-types.pdf"}, |
| 34 | {$td->FILE => "object-types.out", | 34 | {$td->FILE => "object-types.out", |