From cb769c62e55599e9f980001830bc61d9fcaa64a9 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 8 Feb 2022 09:18:08 -0500 Subject: WHITESPACE ONLY -- expand tabs in source code This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon. --- examples/qtest/bookmarks.test | 46 +++++++++--------- examples/qtest/count-strings.test | 4 +- examples/qtest/create.test | 4 +- examples/qtest/double-page-size.test | 14 +++--- examples/qtest/filter-tokens.test | 8 ++-- examples/qtest/invert-images.test | 14 +++--- examples/qtest/linearize.test | 10 ++-- examples/qtest/mod-info.test | 90 ++++++++++++++++++------------------ examples/qtest/name-number-tree.test | 10 ++-- examples/qtest/npages.test | 14 +++--- examples/qtest/overlay-page.test | 16 +++---- examples/qtest/parse-content.test | 6 +-- examples/qtest/pdf-split-pages.test | 12 ++--- examples/qtest/qpdf-job.test | 4 +- examples/qtest/qpdfjob-c.test | 8 ++-- examples/qtest/set-form-values.test | 8 ++-- 16 files changed, 134 insertions(+), 134 deletions(-) (limited to 'examples/qtest') diff --git a/examples/qtest/bookmarks.test b/examples/qtest/bookmarks.test index cff8fc60..e5e3172b 100644 --- a/examples/qtest/bookmarks.test +++ b/examples/qtest/bookmarks.test @@ -15,38 +15,38 @@ foreach my $show ("", " --show-open") { my $xshow = $show ? $show : "x"; my $xstyle = $style ? $style : "x"; - my $out = "test.$xshow.$xstyle.out"; - $out =~ s/ //g; - $td->runtest("show:$show, style:$style", - {$td->COMMAND => "pdf-bookmarks $show $style 1.pdf"}, - {$td->FILE => $out, $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + my $out = "test.$xshow.$xstyle.out"; + $out =~ s/ //g; + $td->runtest("show:$show, style:$style", + {$td->COMMAND => "pdf-bookmarks $show $style 1.pdf"}, + {$td->FILE => $out, $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); } } $td->runtest("no bookmarks", - {$td->COMMAND => "pdf-bookmarks 2.pdf"}, - {$td->STRING => "2.pdf has no bookmarks\n", - $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-bookmarks 2.pdf"}, + {$td->STRING => "2.pdf has no bookmarks\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("bad", - {$td->COMMAND => "pdf-bookmarks 3.pdf"}, - {$td->REGEXP => "pdf-bookmarks processing file 3.pdf: " . - ".*unable to find trailer.*", - $td->EXIT_STATUS => 2}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-bookmarks 3.pdf"}, + {$td->REGEXP => "pdf-bookmarks processing file 3.pdf: " . + ".*unable to find trailer.*", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->runtest("encrypted, targets", - {$td->COMMAND => "pdf-bookmarks --show-targets 4.pdf user"}, - {$td->FILE => "encrypted.out", - $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-bookmarks --show-targets 4.pdf user"}, + {$td->FILE => "encrypted.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("bookmarks deleted", - {$td->COMMAND => "pdf-bookmarks 5.pdf user"}, - {$td->STRING => "5.pdf has no bookmarks\n", - $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-bookmarks 5.pdf user"}, + {$td->STRING => "5.pdf has no bookmarks\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("non-trivial pdf doc to unicode", {$td->COMMAND => "pdf-bookmarks issue-179.pdf"}, diff --git a/examples/qtest/count-strings.test b/examples/qtest/count-strings.test index ba3f835b..c56d1b62 100644 --- a/examples/qtest/count-strings.test +++ b/examples/qtest/count-strings.test @@ -10,8 +10,8 @@ require TestDriver; my $td = new TestDriver('pdf-count-strings'); $td->runtest("filter tokens", - {$td->COMMAND => "pdf-count-strings in.pdf"}, - {$td->FILE => "out", $td->EXIT_STATUS => 0}, + {$td->COMMAND => "pdf-count-strings in.pdf"}, + {$td->FILE => "out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); $td->report(1); diff --git a/examples/qtest/create.test b/examples/qtest/create.test index f18c5fd6..6bf075f4 100644 --- a/examples/qtest/create.test +++ b/examples/qtest/create.test @@ -12,8 +12,8 @@ cleanup(); my $td = new TestDriver('create'); $td->runtest("create a simple PDF", - {$td->COMMAND => "pdf-create a.pdf"}, - {$td->FILE => "create.out", $td->EXIT_STATUS => 0}, + {$td->COMMAND => "pdf-create a.pdf"}, + {$td->FILE => "create.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); cleanup(); diff --git a/examples/qtest/double-page-size.test b/examples/qtest/double-page-size.test index 780a8f0d..a7d6968e 100644 --- a/examples/qtest/double-page-size.test +++ b/examples/qtest/double-page-size.test @@ -12,16 +12,16 @@ my $td = new TestDriver('double-page-size'); cleanup(); $td->runtest("double page size", - {$td->COMMAND => ['pdf-double-page-size', ' --static-id', + {$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}, - $td->NORMALIZE_NEWLINES); + {$td->STRING => + "pdf-double-page-size: new file written to a.pdf\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); cleanup(); diff --git a/examples/qtest/filter-tokens.test b/examples/qtest/filter-tokens.test index e7e458ac..3275dbc4 100644 --- a/examples/qtest/filter-tokens.test +++ b/examples/qtest/filter-tokens.test @@ -12,12 +12,12 @@ my $td = new TestDriver('pdf-filter-tokens'); cleanup(); $td->runtest("filter tokens", - {$td->COMMAND => "pdf-filter-tokens in.pdf a.pdf"}, - {$td->STRING => "", $td->EXIT_STATUS => 0}); + {$td->COMMAND => "pdf-filter-tokens in.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); cleanup(); diff --git a/examples/qtest/invert-images.test b/examples/qtest/invert-images.test index 33ffca47..d1e3c939 100644 --- a/examples/qtest/invert-images.test +++ b/examples/qtest/invert-images.test @@ -12,16 +12,16 @@ my $td = new TestDriver('invert-images'); cleanup(); $td->runtest("invert images", - {$td->COMMAND => ['pdf-invert-images', ' --static-id', + {$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}, - $td->NORMALIZE_NEWLINES); + {$td->STRING => + "pdf-invert-images: new file written to a.pdf\n", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); cleanup(); diff --git a/examples/qtest/linearize.test b/examples/qtest/linearize.test index 94fbcd05..711e697b 100644 --- a/examples/qtest/linearize.test +++ b/examples/qtest/linearize.test @@ -14,14 +14,14 @@ my $td = new TestDriver('linearize'); my $qpdf = $ENV{'QPDF_BIN'} or die; $td->runtest("linearize", - {$td->COMMAND => "pdf-linearize input.pdf '' a.pdf"}, - {$td->REGEXP => '(?s).*input\.pdf progress: \d+\%.*', + {$td->COMMAND => "pdf-linearize input.pdf '' a.pdf"}, + {$td->REGEXP => '(?s).*input\.pdf progress: \d+\%.*', $td->EXIT_STATUS => 0}); $td->runtest("check", - {$td->COMMAND => "$qpdf --check a.pdf"}, - {$td->FILE => "check.out", $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$qpdf --check a.pdf"}, + {$td->FILE => "check.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); cleanup(); diff --git a/examples/qtest/mod-info.test b/examples/qtest/mod-info.test index 5f927170..ec09df9e 100644 --- a/examples/qtest/mod-info.test +++ b/examples/qtest/mod-info.test @@ -16,65 +16,65 @@ my $qpdf = $ENV{'QPDF_BIN'} or die; cleanup(); $td->runtest("usage #1", - {$td->COMMAND => "$prg --in target.pdf"}, - {$td->FILE => "usage.out", - $td->EXIT_STATUS => 2}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$prg --in target.pdf"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->runtest("usage #2", - {$td->COMMAND => "$prg --key abc --val def"}, - {$td->FILE => "usage.out", - $td->EXIT_STATUS => 2}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$prg --key abc --val def"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->runtest("usage #3", - {$td->COMMAND => "$prg --key abc --val def abc"}, - {$td->FILE => "usage.out", - $td->EXIT_STATUS => 2}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$prg --key abc --val def abc"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->runtest("usage #4", - {$td->COMMAND => "$prg --in source1.pdf --key date --val 01/01/01 --val 12/12/12"}, - {$td->FILE => "usage.out", - $td->EXIT_STATUS => 2}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$prg --in source1.pdf --key date --val 01/01/01 --val 12/12/12"}, + {$td->FILE => "usage.out", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->runtest("dump #1", - {$td->COMMAND => "$prg --dump files/source1.pdf"}, - {$td->FILE => "dump.out", - $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$prg --dump files/source1.pdf"}, + {$td->FILE => "dump.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("dump #2", - {$td->COMMAND => "$prg --dump files/no-info.pdf"}, - {$td->STRING => "", - $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "$prg --dump files/no-info.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("dump #3", - {$td->COMMAND => "$prg --dump files/empty-info.pdf"}, - {$td->STRING => "", - $td->EXIT_STATUS => 0}); + {$td->COMMAND => "$prg --dump files/empty-info.pdf"}, + {$td->STRING => "", + $td->EXIT_STATUS => 0}); run_and_cmp("modify Subject", - "$prg --in files/source1.pdf --out out.pdf --key Subject " . - "--val \"Export Business\"", - "", "out.pdf", "files/1.qdf"); + "$prg --in files/source1.pdf --out out.pdf --key Subject " . + "--val \"Export Business\"", + "", "out.pdf", "files/1.qdf"); run_and_cmp("add Subject, remove Producer, modify CreationDate", - "$prg --in files/source2.pdf --out out.pdf --key Subject " . - "--val \"Tammlin\" --key Producer --key CreationDate --val 12/12", - "", "out.pdf", "files/2.qdf"); + "$prg --in files/source2.pdf --out out.pdf --key Subject " . + "--val \"Tammlin\" --key Producer --key CreationDate --val 12/12", + "", "out.pdf", "files/2.qdf"); run_and_cmp("add Subject (empty-info file)", - "$prg --in files/empty-info.pdf --out out.pdf --key Subject " . - "--val Tammlin", - "", "out.pdf", "files/3.qdf"); + "$prg --in files/empty-info.pdf --out out.pdf --key Subject " . + "--val Tammlin", + "", "out.pdf", "files/3.qdf"); copy("files/no-info.pdf", "no-info.pdf") or die "can't copy no-info: $!"; run_and_cmp("in-place Producer added (no-info file)", - "$prg --in no-info.pdf --key Producer --val \"Obivan Kinobi\"", - "", "no-info.pdf", "files/4.qdf"); + "$prg --in no-info.pdf --key Producer --val \"Obivan Kinobi\"", + "", "no-info.pdf", "files/4.qdf"); cleanup(); @@ -89,12 +89,12 @@ sub run_and_cmp { my ($dsc, $cmd, $out, $fout, $fexp) = @_; $td->runtest($dsc, - {$td->COMMAND => "$cmd --static-id"}, - {$td->STRING => $out, - $td->EXIT_STATUS => 0}); + {$td->COMMAND => "$cmd --static-id"}, + {$td->STRING => $out, + $td->EXIT_STATUS => 0}); $td->runtest("$dsc output", - {$td->COMMAND => "$qpdf --static-id" . - " --no-original-object-ids -qdf $fout -"}, - {$td->FILE => $fexp, - $td->EXIT_STATUS => 0}); + {$td->COMMAND => "$qpdf --static-id" . + " --no-original-object-ids -qdf $fout -"}, + {$td->FILE => $fexp, + $td->EXIT_STATUS => 0}); } diff --git a/examples/qtest/name-number-tree.test b/examples/qtest/name-number-tree.test index f3e433fd..e7fcf24e 100644 --- a/examples/qtest/name-number-tree.test +++ b/examples/qtest/name-number-tree.test @@ -12,13 +12,13 @@ my $td = new TestDriver('name-number-tree'); cleanup(); $td->runtest("name/number tree", - {$td->COMMAND => 'pdf-name-number-tree a.pdf'}, - {$td->FILE => 'nn.out', $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => 'pdf-name-number-tree a.pdf'}, + {$td->FILE => 'nn.out', $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); cleanup(); diff --git a/examples/qtest/npages.test b/examples/qtest/npages.test index 191e8d8f..d41de55a 100644 --- a/examples/qtest/npages.test +++ b/examples/qtest/npages.test @@ -10,14 +10,14 @@ require TestDriver; my $td = new TestDriver('pdf-npages'); $td->runtest("normal", - {$td->COMMAND => "pdf-npages minimal.pdf"}, - {$td->STRING => "1\n", $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-npages minimal.pdf"}, + {$td->STRING => "1\n", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->runtest("error", - {$td->COMMAND => "pdf-npages bad"}, - {$td->REGEXP => "pdf-npages: bad: unable to find trailer.*", - $td->EXIT_STATUS => 2}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-npages bad"}, + {$td->REGEXP => "pdf-npages: bad: unable to find trailer.*", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->report(2); diff --git a/examples/qtest/overlay-page.test b/examples/qtest/overlay-page.test index a946b0ca..be9bcb10 100644 --- a/examples/qtest/overlay-page.test +++ b/examples/qtest/overlay-page.test @@ -12,18 +12,18 @@ my $td = new TestDriver('overlay-page'); cleanup(); $td->runtest("overlay-page", - {$td->COMMAND => "pdf-overlay-page in.pdf stamp.pdf a.pdf"}, - {$td->STRING => "", $td->EXIT_STATUS => 0}); + {$td->COMMAND => "pdf-overlay-page in.pdf stamp.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); $td->runtest("overlay-page with fields/ annotations", - {$td->COMMAND => "pdf-overlay-page in.pdf annotations.pdf a.pdf"}, - {$td->STRING => "", $td->EXIT_STATUS => 0}); + {$td->COMMAND => "pdf-overlay-page in.pdf annotations.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "a.pdf"}, - {$td->FILE => "annotations-out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "annotations-out.pdf"}); cleanup(); diff --git a/examples/qtest/parse-content.test b/examples/qtest/parse-content.test index a73566f8..6a9d94fc 100644 --- a/examples/qtest/parse-content.test +++ b/examples/qtest/parse-content.test @@ -10,8 +10,8 @@ require TestDriver; my $td = new TestDriver('pdf-parse-content'); $td->runtest("parse content", - {$td->COMMAND => "pdf-parse-content input.pdf 1"}, - {$td->FILE => "content.out", $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES); + {$td->COMMAND => "pdf-parse-content input.pdf 1"}, + {$td->FILE => "content.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); $td->report(1); diff --git a/examples/qtest/pdf-split-pages.test b/examples/qtest/pdf-split-pages.test index ce271b35..05be22e0 100644 --- a/examples/qtest/pdf-split-pages.test +++ b/examples/qtest/pdf-split-pages.test @@ -12,16 +12,16 @@ my $td = new TestDriver('pdf-split-pages'); cleanup(); $td->runtest("split", - {$td->COMMAND => "pdf-split-pages ' --static-id' in.pdf out"}, - {$td->STRING => "", $td->EXIT_STATUS => 0}); + {$td->COMMAND => "pdf-split-pages ' --static-id' in.pdf out"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("check page 1", - {$td->FILE => "out1.pdf"}, - {$td->FILE => "exp1.pdf"}); + {$td->FILE => "out1.pdf"}, + {$td->FILE => "exp1.pdf"}); $td->runtest("check page 2", - {$td->FILE => "out2.pdf"}, - {$td->FILE => "exp2.pdf"}); + {$td->FILE => "out2.pdf"}, + {$td->FILE => "exp2.pdf"}); cleanup(); diff --git a/examples/qtest/qpdf-job.test b/examples/qtest/qpdf-job.test index d3a490ab..c19cc260 100644 --- a/examples/qtest/qpdf-job.test +++ b/examples/qtest/qpdf-job.test @@ -12,8 +12,8 @@ cleanup(); my $td = new TestDriver('qpdf-job'); $td->runtest("qpdf-job", - {$td->COMMAND => "qpdf-job"}, - {$td->FILE => "out", $td->EXIT_STATUS => 0}, + {$td->COMMAND => "qpdf-job"}, + {$td->FILE => "out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); for (my $i = 1; $i <= 3; ++$i) { diff --git a/examples/qtest/qpdfjob-c.test b/examples/qtest/qpdfjob-c.test index 33a55431..a01b2c64 100644 --- a/examples/qtest/qpdfjob-c.test +++ b/examples/qtest/qpdfjob-c.test @@ -12,12 +12,12 @@ cleanup(); my $td = new TestDriver('qpdfjob-c'); $td->runtest("qpdfjob-c", - {$td->COMMAND => "qpdfjob-c in.pdf a.pdf"}, - {$td->STRING => "", $td->EXIT_STATUS => 0}, + {$td->COMMAND => "qpdfjob-c in.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); cleanup(); diff --git a/examples/qtest/set-form-values.test b/examples/qtest/set-form-values.test index 92f1cef1..8c103379 100644 --- a/examples/qtest/set-form-values.test +++ b/examples/qtest/set-form-values.test @@ -12,11 +12,11 @@ my $td = new TestDriver('pdf-set-form-values'); cleanup(); $td->runtest("set form values", - {$td->COMMAND => "pdf-set-form-values form-in.pdf a.pdf soup"}, - {$td->STRING => "", $td->EXIT_STATUS => 0}); + {$td->COMMAND => "pdf-set-form-values form-in.pdf a.pdf soup"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "a.pdf"}, - {$td->FILE => "form-out.pdf"}); + {$td->FILE => "a.pdf"}, + {$td->FILE => "form-out.pdf"}); cleanup(); -- cgit v1.2.3-70-g09d2