diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pdf-double-page-size.cc | 11 | ||||
-rw-r--r-- | examples/pdf-invert-images.cc | 11 | ||||
-rw-r--r-- | examples/qtest/double-page-size.test | 3 | ||||
-rw-r--r-- | examples/qtest/invert-images.test | 3 |
4 files changed, 24 insertions, 4 deletions
diff --git a/examples/pdf-double-page-size.cc b/examples/pdf-double-page-size.cc index 8a1867aa..2236265b 100644 --- a/examples/pdf-double-page-size.cc +++ b/examples/pdf-double-page-size.cc @@ -51,6 +51,15 @@ int main(int argc, char* argv[]) whoami += 3; } + // For test suite + bool static_id = false; + if ((argc > 1) && (strcmp(argv[1], " --static-id") == 0)) + { + static_id = true; + --argc; + ++argv; + } + if (! ((argc == 3) || (argc == 4))) { usage(); @@ -88,7 +97,7 @@ int main(int argc, char* argv[]) // Write out a new file QPDFWriter w(qpdf, outfilename); - if (QUtil::get_env("IN_TESTSUITE")) + if (static_id) { // For the test suite, uncompress streams and use static // IDs. diff --git a/examples/pdf-invert-images.cc b/examples/pdf-invert-images.cc index f4a4e4ab..867c89c7 100644 --- a/examples/pdf-invert-images.cc +++ b/examples/pdf-invert-images.cc @@ -70,6 +70,15 @@ int main(int argc, char* argv[]) whoami += 3; } + // For test suite + bool static_id = false; + if ((argc > 1) && (strcmp(argv[1], " --static-id") == 0)) + { + static_id = true; + --argc; + ++argv; + } + if (! ((argc == 3) || (argc == 4))) { usage(); @@ -149,7 +158,7 @@ int main(int argc, char* argv[]) // Write out a new file QPDFWriter w(qpdf, outfilename); - if (QUtil::get_env("IN_TESTSUITE")) + if (static_id) { // For the test suite, uncompress streams and use static // IDs. diff --git a/examples/qtest/double-page-size.test b/examples/qtest/double-page-size.test index 0c4a08bd..780a8f0d 100644 --- a/examples/qtest/double-page-size.test +++ b/examples/qtest/double-page-size.test @@ -12,7 +12,8 @@ my $td = new TestDriver('double-page-size'); cleanup(); $td->runtest("double page size", - {$td->COMMAND => "pdf-double-page-size in.pdf a.pdf"}, + {$td->COMMAND => ['pdf-double-page-size', ' --static-id', + 'in.pdf', 'a.pdf']}, {$td->STRING => "pdf-double-page-size: new file written to a.pdf\n", $td->EXIT_STATUS => 0}, diff --git a/examples/qtest/invert-images.test b/examples/qtest/invert-images.test index 0dc15a28..0f5a2f1e 100644 --- a/examples/qtest/invert-images.test +++ b/examples/qtest/invert-images.test @@ -12,7 +12,8 @@ my $td = new TestDriver('invert-images'); cleanup(); $td->runtest("double page size", - {$td->COMMAND => "pdf-invert-images in.pdf a.pdf"}, + {$td->COMMAND => ['pdf-invert-images', ' --static-id', + 'in.pdf', 'a.pdf']}, {$td->STRING => "pdf-invert-images: new file written to a.pdf\n", $td->EXIT_STATUS => 0}, |