aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/invalid-objects.test
blob: 6491ccdb11443ca2f6e140ac72b55a17ba259a47 (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('invalid-objects');

my $n_tests = 3;

$td->runtest("closed input source",
             {$td->COMMAND => "test_driver 73 minimal.pdf"},
             {$td->FILE => "test73.out",
              $td->EXIT_STATUS => 2},
             $td->NORMALIZE_NEWLINES);

$td->runtest("empty object",
             {$td->COMMAND => "qpdf -show-object=7,0 empty-object.pdf"},
             {$td->FILE => "empty-object.out",
              $td->EXIT_STATUS => 3},
             $td->NORMALIZE_NEWLINES);

$td->runtest("object with zero offset",
             {$td->COMMAND => "qpdf --check zero-offset.pdf"},
             {$td->FILE => "zero-offset.out", $td->EXIT_STATUS => 3},
             $td->NORMALIZE_NEWLINES);

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