2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 03:40:53 +00:00

Rename test files

This change makes it possible to get both the user and owner password
from the file name of all the encryption test files.
This commit is contained in:
Jay Berkenbilt 2020-01-26 14:38:44 -05:00
parent 731c4f711b
commit 656d7bc006
4 changed files with 8 additions and 7 deletions

View File

@ -3100,7 +3100,7 @@ my @encrypted_files =
['R3,V2', '', # 2
'-accessibility=n -extract=n -print=full -modify=all', -532,
1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1],
['R3,V2,U=view', 'view', # 3
['R3,V2,U=view,O=view', 'view', # 3
'-accessibility=y -extract=n -print=none -modify=none', -3392,
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
['R3,V2,O=master', 'master', # 4
@ -3136,7 +3136,7 @@ my @encrypted_files =
['R2,V1', '', # 14
'-print=n -modify=n -extract=n -annotate=n', -64,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
['R2,V1,U=view', 'view', # 15
['R2,V1,U=view,O=view', 'view', # 15
'-print=y -modify=n -extract=n -annotate=n', -60,
1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0],
['R2,V1,O=master', 'master', # 16
@ -3342,12 +3342,13 @@ $td->runtest("non-encrypted",
$td->runtest("invalid password",
{$td->COMMAND => "qpdf -qdf --password=quack" .
" enc-R2,V1,U=view.pdf a.qdf"},
{$td->STRING => "enc-R2,V1,U=view.pdf: invalid password\n",
" enc-R2,V1,U=view,O=view.pdf a.qdf"},
{$td->STRING => "enc-R2,V1,U=view,O=view.pdf: invalid password\n",
$td->EXIT_STATUS => 2},
$td->NORMALIZE_NEWLINES);
$td->runtest("C API: invalid password",
{$td->COMMAND => "qpdf-ctest 2 enc-R2,V1,U=view.pdf '' a.qdf"},
{$td->COMMAND =>
"qpdf-ctest 2 enc-R2,V1,U=view,O=view.pdf '' a.qdf"},
{$td->FILE => "c-invalid-password.out", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);

View File

@ -1,5 +1,5 @@
error: enc-R2,V1,U=view.pdf: invalid password
error: enc-R2,V1,U=view,O=view.pdf: invalid password
code: 4
file: enc-R2,V1,U=view.pdf
file: enc-R2,V1,U=view,O=view.pdf
pos : 0
text: invalid password