#!/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('fix-qdf');

my $n_tests = 5;

for (my $n = 1; $n <= 2; ++$n)
{
    $td->runtest("fix-qdf $n",
                 {$td->COMMAND => "fix-qdf fix$n.qdf"},
                 {$td->FILE => "fix$n.qdf.out",
                  $td->EXIT_STATUS => 0});

    $td->runtest("identity fix-qdf $n",
                 {$td->COMMAND => "fix-qdf fix$n.qdf.out"},
                 {$td->FILE => "fix$n.qdf.out",
                  $td->EXIT_STATUS => 0});
}
$td->runtest("fix-qdf with big object stream", # > 255 objects in a stream
             {$td->COMMAND => "fix-qdf big-ostream.pdf"},
             {$td->FILE => "big-ostream.pdf",
              $td->EXIT_STATUS => 0});

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