[Reproducible-commits] [strip-nondeterminism] 01/01: Add test fixtures for PNG handler.

Chris Lamb chris at chris-lamb.co.uk
Sun Jul 24 11:41:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository strip-nondeterminism.

commit 874b80b28df45040cb4889e0b7ca07731d15fa1f
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Jul 24 12:41:03 2016 +0100

    Add test fixtures for PNG handler.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 t/fixtures/png/1x1.in.png              | Bin 0 -> 95 bytes
 t/fixtures/png/1x1.out.png             |   1 +
 t/fixtures/png/huge-chunk-size.in.png  | Bin 0 -> 512 bytes
 t/fixtures/png/huge-chunk-size.out.png |   1 +
 t/fixtures/png/kmidimon1.in.png        | Bin 0 -> 77667 bytes
 t/fixtures/png/kmidimon1.out.png       |   1 +
 t/png.t                                |  44 +++++++++++++++++++++++++++++++++
 7 files changed, 47 insertions(+)

diff --git a/t/fixtures/png/1x1.in.png b/t/fixtures/png/1x1.in.png
new file mode 100644
index 0000000..1914264
Binary files /dev/null and b/t/fixtures/png/1x1.in.png differ
diff --git a/t/fixtures/png/1x1.out.png b/t/fixtures/png/1x1.out.png
new file mode 120000
index 0000000..17050ca
--- /dev/null
+++ b/t/fixtures/png/1x1.out.png
@@ -0,0 +1 @@
+1x1.in.png
\ No newline at end of file
diff --git a/t/fixtures/png/huge-chunk-size.in.png b/t/fixtures/png/huge-chunk-size.in.png
new file mode 100644
index 0000000..7308553
Binary files /dev/null and b/t/fixtures/png/huge-chunk-size.in.png differ
diff --git a/t/fixtures/png/huge-chunk-size.out.png b/t/fixtures/png/huge-chunk-size.out.png
new file mode 120000
index 0000000..85c4f24
--- /dev/null
+++ b/t/fixtures/png/huge-chunk-size.out.png
@@ -0,0 +1 @@
+huge-chunk-size.in.png
\ No newline at end of file
diff --git a/t/fixtures/png/kmidimon1.in.png b/t/fixtures/png/kmidimon1.in.png
new file mode 100644
index 0000000..f9866d2
Binary files /dev/null and b/t/fixtures/png/kmidimon1.in.png differ
diff --git a/t/fixtures/png/kmidimon1.out.png b/t/fixtures/png/kmidimon1.out.png
new file mode 120000
index 0000000..6676c96
--- /dev/null
+++ b/t/fixtures/png/kmidimon1.out.png
@@ -0,0 +1 @@
+kmidimon1.in.png
\ No newline at end of file
diff --git a/t/png.t b/t/png.t
new file mode 100644
index 0000000..dcb0227
--- /dev/null
+++ b/t/png.t
@@ -0,0 +1,44 @@
+#!perl
+
+#
+# Copyright 2016 Chris Lamb <lamby at debian.org>
+#
+# This file is part of strip-nondeterminism.
+#
+# strip-nondeterminism is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# strip-nondeterminism is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with strip-nondeterminism.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+use File::Basename qw(basename);
+use File::Compare qw(compare);
+use File::Copy qw(copy);
+use File::Temp qw(tempdir);
+use File::StripNondeterminism;
+use Test::More;
+
+$dir = tempdir( CLEANUP => 1 );
+
+my @fixtures = glob('t/fixtures/png/*.in.png');
+plan tests => scalar @fixtures;
+
+foreach (@fixtures) {
+	my $name = basename($_, '.in.png');
+	my $path = "$dir/$name.in.png";
+
+	copy("t/fixtures/png/$name.in.png", $path) or die "Copy failed: $!";
+
+	$normalizer = File::StripNondeterminism::get_normalizer_for_file($path);
+	$normalizer->($path);
+
+	ok(compare($path, "t/fixtures/png/$name.out.png") == 0, $name);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/strip-nondeterminism.git



More information about the Reproducible-commits mailing list