Commit 321f9e79db85fe67a3cc498780dbe88602483b16

Authored by Jay Berkenbilt
1 parent 647b9831

Fix tests with deterministic IDs

qpdf/qtest/error-condition.test
... ... @@ -194,8 +194,8 @@ $td->runtest("xref loop with append",
194 194 $td->EXIT_STATUS => 3},
195 195 $td->NORMALIZE_NEWLINES);
196 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 200 $td->runtest("endobj not at newline",
201 201 {$td->COMMAND =>
... ... @@ -204,8 +204,8 @@ $td->runtest("endobj not at newline",
204 204 $td->EXIT_STATUS => 3},
205 205 $td->NORMALIZE_NEWLINES);
206 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 210 cleanup();
211 211 $td->report($n_tests);
... ...
qpdf/qtest/form-xobject.test
... ... @@ -94,8 +94,8 @@ $td->runtest("overlay on page with no resources",
94 94 {$td->STRING => "", $td->EXIT_STATUS => 0},
95 95 $td->NORMALIZE_NEWLINES);
96 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 100 cleanup();
101 101 $td->report($n_tests);
... ...
qpdf/qtest/many-nulls.test
... ... @@ -23,9 +23,8 @@ $td->runtest("create file with many nulls",
23 23 {$td->STRING => "", $td->EXIT_STATUS => 0},
24 24 $td->NORMALIZE_NEWLINES);
25 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 28 $td->runtest("run check file",
30 29 {$td->COMMAND => "qpdf --check a.pdf"},
31 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 32 " --object-streams=generate --replace-input ./$u.pdf"},
33 33 {$td->STRING => "", $td->EXIT_STATUS => 0},
34 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 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 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 48 $td->NORMALIZE_NEWLINES);
47 49  
48 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 53 $td->runtest("check orig output",
52 54 {$td->FILE => "auto-warn.pdf.~qpdf-orig"},
53 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 27 " object-types.pdf a.pdf"},
28 28 {$td->STRING => "", $td->EXIT_STATUS => 0});
29 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 32 $td->runtest("type checks",
33 33 {$td->COMMAND => "test_driver 42 object-types.pdf"},
34 34 {$td->FILE => "object-types.out",
... ...