aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/many-nulls.test
blob: 8a723d5390bde14d1c845f87f670efff0ad5b05c (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('many-nulls');

# The output of test_many_nulls is also used in performance testing.
# If it changes, consider whether it should be updated in
# performance-test-files as well. See performance_check at the top of
# the source tree.
$td->runtest("create file with many nulls",
             {$td->COMMAND => "test_many_nulls a.pdf"},
             {$td->STRING => "", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
$td->runtest("compare output",
             {$td->COMMAND => "qpdf-test-compare a.pdf many-nulls.pdf"},
             {$td->FILE => "many-nulls.pdf", $td->EXIT_STATUS => 0});
$td->runtest("run check file",
             {$td->COMMAND => "qpdf --check a.pdf"},
             {$td->FILE => "many-nulls.out", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
$td->runtest("copy sparse array",
             {$td->COMMAND => "test_driver 97 many-nulls.pdf"},
             {$td->STRING => "test 97 done\n", $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);
cleanup();
$td->report(4);