diff options
author | Jay Berkenbilt <ejb@ql.org> | 2017-07-28 00:18:18 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2017-07-28 00:43:07 +0200 |
commit | a4fd4b91c6f7f732536bd113cd7b4e23a08ca599 (patch) | |
tree | 3e617732b8feff546373150d69afe9ac493a230f /qpdf | |
parent | 40f00122b811ca5c8788856f5baf4e5e088926eb (diff) | |
download | qpdf-a4fd4b91c6f7f732536bd113cd7b4e23a08ca599.tar.zst |
Convert stream filtering errors to warnings
Diffstat (limited to 'qpdf')
-rw-r--r-- | qpdf/qpdf.testcov | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf.test | 15 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/bad30-recover.out | 6 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/bad30.out | 6 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/bad33-recover.out | 6 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/c-write-errors.out | 5 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/c-write-warnings.out (renamed from qpdf/qtest/qpdf/c-write-warnings-and-errors.out) | 7 | ||||
-rw-r--r-- | qpdf/test_driver.cc | 2 |
8 files changed, 28 insertions, 21 deletions
diff --git a/qpdf/qpdf.testcov b/qpdf/qpdf.testcov index 20859984..35a7ba78 100644 --- a/qpdf/qpdf.testcov +++ b/qpdf/qpdf.testcov @@ -139,7 +139,7 @@ qpdf-c called qpdf_set_preserve_encryption 0 qpdf-c called qpdf_set_r2_encryption_parameters 0 qpdf-c called qpdf_set_r3_encryption_parameters 0 qpdf-c called qpdf_set_linearization 0 -qpdf-c called qpdf_write 3 +qpdf-c called qpdf_write 1 qpdf-c called qpdf_allow_accessibility 0 qpdf-c called qpdf_allow_extract_all 0 qpdf-c called qpdf_allow_print_low_res 0 diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index d69ccdc2..8378e7b3 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -787,7 +787,7 @@ my @badfiles = ("not a PDF file", # 1 "bad dictionary key", # 36 ); -$n_tests += @badfiles + 4; +$n_tests += @badfiles + 3; # Test 6 contains errors in the free table consistency, but we no # longer have any consistency check for this since it is not important @@ -796,7 +796,7 @@ $n_tests += @badfiles + 4; # non-fatal. my %badtest_overrides = (6 => 0, 12 => 0, 13 => 0, 14 => 0, 15 => 0, 17 => 0, - 28 => 0, 31 => 0, 36 => 0); + 28 => 0, 30 => 0, 31 => 0, 36 => 0); for (my $i = 1; $i <= scalar(@badfiles); ++$i) { my $status = $badtest_overrides{$i}; @@ -813,14 +813,9 @@ $td->runtest("C API: errors", {$td->FILE => "c-read-errors.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); -$td->runtest("C API: errors writing", - {$td->COMMAND => "qpdf-ctest 2 bad30.pdf '' a.pdf"}, - {$td->FILE => "c-write-errors.out", - $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); -$td->runtest("C API: errors and warnings writing", +$td->runtest("C API: warnings writing", {$td->COMMAND => "qpdf-ctest 2 bad33.pdf '' a.pdf"}, - {$td->FILE => "c-write-warnings-and-errors.out", + {$td->FILE => "c-write-warnings.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); $td->runtest("C API: no recovery", @@ -840,7 +835,7 @@ $n_tests += @badfiles + 8; # though in some cases it may. Acrobat Reader would not be able to # recover any of these files any better. my %recover_failures = (); -for (1, 7, 16, 18..21, 24, 29..30, 33, 35) +for (1, 7, 16, 18..21, 24, 29, 35) { $recover_failures{$_} = 1; } diff --git a/qpdf/qtest/qpdf/bad30-recover.out b/qpdf/qtest/qpdf/bad30-recover.out index 5e228a58..dc59da20 100644 --- a/qpdf/qtest/qpdf/bad30-recover.out +++ b/qpdf/qtest/qpdf/bad30-recover.out @@ -3,4 +3,8 @@ Raw stream data: x%11b;t4| wXID8G>rQuOE:IWPlII)rp4~;As/҅jcszT.?u<*6 Uncompressed stream data: -bad30.pdf (file position 629): stream filter type is not name or array +WARNING: bad30.pdf (file position 629): stream filter type is not name or array +Stream data is not filterable. +unparse: 7 0 R +unparseResolved: 7 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/bad30.out b/qpdf/qtest/qpdf/bad30.out index 5e228a58..fc0780c6 100644 --- a/qpdf/qtest/qpdf/bad30.out +++ b/qpdf/qtest/qpdf/bad30.out @@ -3,4 +3,8 @@ Raw stream data: x%11b;t4| wXID8G>rQuOE:IWPlII)rp4~;As/҅jcszT.?u<*6 Uncompressed stream data: -bad30.pdf (file position 629): stream filter type is not name or array +WARNING: bad30.pdf (file position 629): stream filter type is not name or array +Stream data is not filterable. +unparse: 7 0 R +unparseResolved: 7 0 R +test 0 done diff --git a/qpdf/qtest/qpdf/bad33-recover.out b/qpdf/qtest/qpdf/bad33-recover.out index 7cb645a7..2269cd41 100644 --- a/qpdf/qtest/qpdf/bad33-recover.out +++ b/qpdf/qtest/qpdf/bad33-recover.out @@ -6,4 +6,8 @@ WARNING: bad33.pdf: Attempting to reconstruct cross-reference table Raw stream data: x%11b;t4| wXID8G>rQuOE:IWPlII)rp4~;As/҅jcszT.?u<*6 Uncompressed stream data: -bad33.pdf (file position 629): stream filter type is not name or array +WARNING: bad33.pdf (file position 629): stream filter type is not name or array +Stream data is not filterable. +unparse: 7 0 R +unparseResolved: 7 0 R +test 1 done diff --git a/qpdf/qtest/qpdf/c-write-errors.out b/qpdf/qtest/qpdf/c-write-errors.out deleted file mode 100644 index 211cfdf9..00000000 --- a/qpdf/qtest/qpdf/c-write-errors.out +++ /dev/null @@ -1,5 +0,0 @@ -error: bad30.pdf (file position 629): stream filter type is not name or array - code: 5 - file: bad30.pdf - pos : 629 - text: stream filter type is not name or array diff --git a/qpdf/qtest/qpdf/c-write-warnings-and-errors.out b/qpdf/qtest/qpdf/c-write-warnings.out index d486d599..bc412658 100644 --- a/qpdf/qtest/qpdf/c-write-warnings-and-errors.out +++ b/qpdf/qtest/qpdf/c-write-warnings.out @@ -13,7 +13,12 @@ warning: bad33.pdf: Attempting to reconstruct cross-reference table file: bad33.pdf pos : 0 text: Attempting to reconstruct cross-reference table -error: bad33.pdf (file position 629): stream filter type is not name or array +warning: bad33.pdf (file position 629): stream filter type is not name or array + code: 5 + file: bad33.pdf + pos : 629 + text: stream filter type is not name or array +warning: bad33.pdf (file position 629): stream filter type is not name or array code: 5 file: bad33.pdf pos : 629 diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc index a40df34e..d1db805e 100644 --- a/qpdf/test_driver.cc +++ b/qpdf/test_driver.cc @@ -567,7 +567,7 @@ void runtest(int n, char const* filename1, char const* arg2) qstream.getStreamData(); std::cout << "oops -- getStreamData didn't throw" << std::endl; } - catch (std::logic_error const& e) + catch (std::exception const& e) { std::cout << "exception: " << e.what() << std::endl; } |