aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/swap-and-replace.test
blob: fd1369335157aa4812399912e6928eb7ddc0dc32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env perl
require 5.008;
use warnings;
use strict;

unshift(@INC, '.');
require qpdf_test_helpers;

chdir("qpdf") or die "chdir testdir failed: $!\n";

require TestDriver;

cleanup();

my $td = new TestDriver('swap-and-replace');

my $n_tests = 3;

$td->runtest("swap and replace",
             {$td->COMMAND => "test_driver 14 test14-in.pdf"},
             {$td->FILE => "test14.out",
              $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
$td->runtest("check output",
             {$td->FILE => "a.pdf"},
             {$td->FILE => "test14-out.pdf"});

# Most of the test suite uses static or deterministic ID. This test
# case exercises regular ID generation. Test 14 also exercises writing
# to memory without static ID.
$td->runtest("check non-static ID version",
             {$td->COMMAND => "sh ./diff-ignore-ID-version a.pdf b.pdf"},
             {$td->STRING => "okay\n", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);

cleanup();
$td->report($n_tests);