mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 10:58:58 +00:00
Avoid depending on exact xref stream offsets
For the modified test case, we care about successful recovery, not about the exact offsets. Add a filter to remove the specific numbers from show-xref.
This commit is contained in:
parent
d61612a2e5
commit
7e679ab8b6
8
qpdf/qtest/qpdf/filter-xref-offsets.pl
Normal file
8
qpdf/qtest/qpdf/filter-xref-offsets.pl
Normal file
@ -0,0 +1,8 @@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
while (<>)
|
||||
{
|
||||
s/(uncompressed; offset =) \d+/$1 .../;
|
||||
print;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
1/0: uncompressed; offset = 15
|
||||
1/0: uncompressed; offset = ...
|
||||
2/0: compressed; stream = 1, index = 0
|
||||
3/0: compressed; stream = 1, index = 1
|
||||
4/0: compressed; stream = 1, index = 2
|
||||
@ -8,6 +8,6 @@
|
||||
8/0: compressed; stream = 1, index = 6
|
||||
9/0: compressed; stream = 1, index = 7
|
||||
10/0: compressed; stream = 1, index = 8
|
||||
11/0: uncompressed; offset = 674
|
||||
12/0: uncompressed; offset = 801
|
||||
13/0: uncompressed; offset = 16194
|
||||
11/0: uncompressed; offset = ...
|
||||
12/0: uncompressed; offset = ...
|
||||
13/0: uncompressed; offset = ...
|
||||
|
@ -28,7 +28,8 @@ $td->runtest("recover xref with short size",
|
||||
$td->EXIT_STATUS => 3},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
$td->runtest("show new xref stream",
|
||||
{$td->COMMAND => "qpdf --show-xref a.pdf"},
|
||||
{$td->COMMAND => "qpdf --show-xref a.pdf",
|
||||
$td->FILTER => "perl filter-xref-offsets.pl"},
|
||||
{$td->FILE => "xref-with-short-size-new.out",
|
||||
$td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
|
Loading…
Reference in New Issue
Block a user