diff options
Diffstat (limited to 'qpdf/qtest')
-rw-r--r-- | qpdf/qtest/qpdf.test | 42 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/forced-version.out | 5 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/min-version.out | 5 |
3 files changed, 50 insertions, 2 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index 1c724ec3..1aba8e15 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -81,7 +81,7 @@ flush_tiff_cache(); show_ntests(); # ---------- $td->notify("--- Miscellaneous Tests ---"); -$n_tests += 7; +$n_tests += 14; foreach (my $i = 1; $i <= 3; ++$i) { @@ -115,6 +115,44 @@ $td->runtest("show new xref stream", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); +# Min/Force version +$td->runtest("set min version", + {$td->COMMAND => "qpdf --min-version=1.6 good1.pdf a.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check version", + {$td->COMMAND => "qpdf --check a.pdf"}, + {$td->FILE => "min-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("force version", + {$td->COMMAND => "qpdf --force-version=1.4 a.pdf b.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check version", + {$td->COMMAND => "qpdf --check b.pdf"}, + {$td->FILE => "forced-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +unlink "a.pdf", "b.pdf" or die; +$td->runtest("C API: min/force versions", + {$td->COMMAND => "qpdf-ctest 14 object-stream.pdf '' a.pdf b.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C check version 1", + {$td->COMMAND => "qpdf --check a.pdf"}, + {$td->FILE => "min-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("C check version 2", + {$td->COMMAND => "qpdf --check b.pdf"}, + {$td->FILE => "forced-version.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + show_ntests(); # ---------- $td->notify("--- Error Condition Tests ---"); @@ -883,7 +921,7 @@ foreach my $d (@cenc) my ($n, $infile, $pass, $description, $output) = @$d; my $outfile = $description; $outfile =~ s/ /-/g; - my $outfile = "c-$outfile.pdf"; + $outfile = "c-$outfile.pdf"; $td->runtest("C API encryption: $description", {$td->COMMAND => "qpdf-ctest $n $infile $pass a.pdf"}, {$td->STRING => $output, $td->EXIT_STATUS => 0}, diff --git a/qpdf/qtest/qpdf/forced-version.out b/qpdf/qtest/qpdf/forced-version.out new file mode 100644 index 00000000..9a71439d --- /dev/null +++ b/qpdf/qtest/qpdf/forced-version.out @@ -0,0 +1,5 @@ +checking b.pdf +PDF Version: 1.4 +File is not encrypted +File is not linearized +No errors found diff --git a/qpdf/qtest/qpdf/min-version.out b/qpdf/qtest/qpdf/min-version.out new file mode 100644 index 00000000..3e34d6a0 --- /dev/null +++ b/qpdf/qtest/qpdf/min-version.out @@ -0,0 +1,5 @@ +checking a.pdf +PDF Version: 1.6 +File is not encrypted +File is not linearized +No errors found |