aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/c-api-page.test
blob: 5b68b0589b6f371c6c2e47a6a83b117daf32f9cf (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
38
39
40
41
42
43
44
45
#!/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('c-api-page');

my $n_tests = 5;

$td->runtest("C page normal",
             {$td->COMMAND =>
                  "qpdf-ctest 34 11-pages.pdf '' a.pdf minimal.pdf"},
             {$td->STRING => "C test 34 done\n", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
$td->runtest("check output",
             {$td->FILE => 'a.pdf'},
             {$td->FILE => 'c-pages.pdf'});

$td->runtest("C page errors",
             {$td->COMMAND =>
                  "qpdf-ctest 35 11-pages.pdf '' ''"},
             {$td->FILE => "c-page-errors.out", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
$td->runtest("C inherited page resources",
             {$td->COMMAND =>
                  "qpdf-ctest 36 inherited-rotate.pdf '' ''"},
             {$td->STRING => "C test 36 done\n", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
$td->runtest("C pages cache",
             {$td->COMMAND =>
                  "qpdf-ctest 37 11-pages.pdf '' ''"},
             {$td->STRING => "C test 37 done\n", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);

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