2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-28 16:00:53 +00:00
qpdf/qpdf/qtest/c-api-stream.test
2022-05-20 09:16:25 -04:00

44 lines
1.2 KiB
Perl

#!/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-stream');
my $n_tests = 5;
$td->runtest("C read streams",
{$td->COMMAND =>
"qpdf-ctest 38 11-pages.pdf '' ''"},
{$td->FILE => "c-get-stream.out", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("C foreign object",
{$td->COMMAND =>
"qpdf-ctest 39 11-pages.pdf '' a.pdf minimal.pdf"},
{$td->STRING => "C test 39 done\n", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("check output",
{$td->FILE => 'a.pdf'},
{$td->FILE => 'c-foreign.pdf'});
$td->runtest("C new stream",
{$td->COMMAND =>
"qpdf-ctest 40 minimal.pdf '' a.pdf"},
{$td->STRING => "C test 40 done\n", $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("check output",
{$td->FILE => 'a.pdf'},
{$td->FILE => 'c-new-stream.pdf'});
cleanup();
$td->report($n_tests);