]> gitweb.factorcode.org Git - factor.git/commitdiff
images.testing: consolidated TIFF/GIF/PNG/PAM test images and wrote PAM unit tests
authorKeith Lazuka <klazuka@gmail.com>
Wed, 30 Sep 2009 17:33:10 +0000 (13:33 -0400)
committerKeith Lazuka <klazuka@gmail.com>
Wed, 30 Sep 2009 17:33:10 +0000 (13:33 -0400)
56 files changed:
basis/images/test-images/1bit.bmp [deleted file]
basis/images/test-images/40red24bit.bmp [deleted file]
basis/images/test-images/41red24bit.bmp [deleted file]
basis/images/test-images/42red24bit.bmp [deleted file]
basis/images/test-images/43red24bit.bmp [deleted file]
basis/images/test-images/elephants.tiff [deleted file]
basis/images/test-images/octagon.tiff [deleted file]
basis/images/test-images/rgb.png [deleted file]
basis/images/test-images/rgb.tiff [deleted file]
basis/images/test-images/rgb4bit.bmp [deleted file]
basis/images/test-images/rgb8bit.bmp [deleted file]
basis/images/test-images/thiswayup24.bmp [deleted file]
basis/images/testing/bmp/1bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/40red24bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/41red24bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/42red24bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/43red24bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/rgb4bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/rgb8bit.bmp [new file with mode: 0644]
basis/images/testing/bmp/thiswayup24.bmp [new file with mode: 0644]
basis/images/testing/gif/alpha.gif [new file with mode: 0644]
basis/images/testing/gif/astronaut_animation.gif [new file with mode: 0644]
basis/images/testing/gif/checkmark.gif [new file with mode: 0644]
basis/images/testing/gif/circle.gif [new file with mode: 0644]
basis/images/testing/gif/monochrome.gif [new file with mode: 0644]
basis/images/testing/gif/noise.gif [new file with mode: 0644]
basis/images/testing/pam/rgb1x1.pam [new file with mode: 0644]
basis/images/testing/pam/rgb2x2.pam [new file with mode: 0644]
basis/images/testing/pam/rgb3x3.pam [new file with mode: 0644]
basis/images/testing/pam/rgba1x1.pam [new file with mode: 0644]
basis/images/testing/pam/rgba2x2.pam [new file with mode: 0644]
basis/images/testing/pam/rgba3x3.pam [new file with mode: 0644]
basis/images/testing/png/rgb.png [new file with mode: 0755]
basis/images/testing/png/yin_yang.png [new file with mode: 0644]
basis/images/testing/testing.factor [new file with mode: 0644]
basis/images/testing/tiff/alpha.tiff [new file with mode: 0644]
basis/images/testing/tiff/color_spectrum.tiff [new file with mode: 0644]
basis/images/testing/tiff/elephants.tiff [new file with mode: 0644]
basis/images/testing/tiff/noise.tiff [new file with mode: 0644]
basis/images/testing/tiff/octagon.tiff [new file with mode: 0644]
basis/images/testing/tiff/rgb.tiff [new file with mode: 0755]
extra/images/pam/pam-tests.factor [new file with mode: 0644]
extra/images/testing/alpha.gif [deleted file]
extra/images/testing/alpha.tiff [deleted file]
extra/images/testing/astronaut_animation.gif [deleted file]
extra/images/testing/bi.tiff [deleted file]
extra/images/testing/checkmark.gif [deleted file]
extra/images/testing/circle.gif [deleted file]
extra/images/testing/color_spectrum.tiff [deleted file]
extra/images/testing/cube.tiff [deleted file]
extra/images/testing/monochrome.gif [deleted file]
extra/images/testing/noise.bmp [deleted file]
extra/images/testing/noise.gif [deleted file]
extra/images/testing/noise.tiff [deleted file]
extra/images/testing/small.tiff [deleted file]
extra/images/testing/square.tiff [deleted file]

diff --git a/basis/images/test-images/1bit.bmp b/basis/images/test-images/1bit.bmp
deleted file mode 100644 (file)
index 2f244c1..0000000
Binary files a/basis/images/test-images/1bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/40red24bit.bmp b/basis/images/test-images/40red24bit.bmp
deleted file mode 100644 (file)
index 5e69455..0000000
Binary files a/basis/images/test-images/40red24bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/41red24bit.bmp b/basis/images/test-images/41red24bit.bmp
deleted file mode 100644 (file)
index 6599dcc..0000000
Binary files a/basis/images/test-images/41red24bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/42red24bit.bmp b/basis/images/test-images/42red24bit.bmp
deleted file mode 100644 (file)
index e95a4f7..0000000
Binary files a/basis/images/test-images/42red24bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/43red24bit.bmp b/basis/images/test-images/43red24bit.bmp
deleted file mode 100644 (file)
index d88f2d4..0000000
Binary files a/basis/images/test-images/43red24bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/elephants.tiff b/basis/images/test-images/elephants.tiff
deleted file mode 100644 (file)
index f462a0c..0000000
Binary files a/basis/images/test-images/elephants.tiff and /dev/null differ
diff --git a/basis/images/test-images/octagon.tiff b/basis/images/test-images/octagon.tiff
deleted file mode 100644 (file)
index 2b4ba39..0000000
Binary files a/basis/images/test-images/octagon.tiff and /dev/null differ
diff --git a/basis/images/test-images/rgb.png b/basis/images/test-images/rgb.png
deleted file mode 100755 (executable)
index d34914a..0000000
Binary files a/basis/images/test-images/rgb.png and /dev/null differ
diff --git a/basis/images/test-images/rgb.tiff b/basis/images/test-images/rgb.tiff
deleted file mode 100755 (executable)
index 71cbaa9..0000000
Binary files a/basis/images/test-images/rgb.tiff and /dev/null differ
diff --git a/basis/images/test-images/rgb4bit.bmp b/basis/images/test-images/rgb4bit.bmp
deleted file mode 100644 (file)
index 0c6f00d..0000000
Binary files a/basis/images/test-images/rgb4bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/rgb8bit.bmp b/basis/images/test-images/rgb8bit.bmp
deleted file mode 100644 (file)
index bc95c0f..0000000
Binary files a/basis/images/test-images/rgb8bit.bmp and /dev/null differ
diff --git a/basis/images/test-images/thiswayup24.bmp b/basis/images/test-images/thiswayup24.bmp
deleted file mode 100644 (file)
index 202fb15..0000000
Binary files a/basis/images/test-images/thiswayup24.bmp and /dev/null differ
diff --git a/basis/images/testing/bmp/1bit.bmp b/basis/images/testing/bmp/1bit.bmp
new file mode 100644 (file)
index 0000000..2f244c1
Binary files /dev/null and b/basis/images/testing/bmp/1bit.bmp differ
diff --git a/basis/images/testing/bmp/40red24bit.bmp b/basis/images/testing/bmp/40red24bit.bmp
new file mode 100644 (file)
index 0000000..5e69455
Binary files /dev/null and b/basis/images/testing/bmp/40red24bit.bmp differ
diff --git a/basis/images/testing/bmp/41red24bit.bmp b/basis/images/testing/bmp/41red24bit.bmp
new file mode 100644 (file)
index 0000000..6599dcc
Binary files /dev/null and b/basis/images/testing/bmp/41red24bit.bmp differ
diff --git a/basis/images/testing/bmp/42red24bit.bmp b/basis/images/testing/bmp/42red24bit.bmp
new file mode 100644 (file)
index 0000000..e95a4f7
Binary files /dev/null and b/basis/images/testing/bmp/42red24bit.bmp differ
diff --git a/basis/images/testing/bmp/43red24bit.bmp b/basis/images/testing/bmp/43red24bit.bmp
new file mode 100644 (file)
index 0000000..d88f2d4
Binary files /dev/null and b/basis/images/testing/bmp/43red24bit.bmp differ
diff --git a/basis/images/testing/bmp/rgb4bit.bmp b/basis/images/testing/bmp/rgb4bit.bmp
new file mode 100644 (file)
index 0000000..0c6f00d
Binary files /dev/null and b/basis/images/testing/bmp/rgb4bit.bmp differ
diff --git a/basis/images/testing/bmp/rgb8bit.bmp b/basis/images/testing/bmp/rgb8bit.bmp
new file mode 100644 (file)
index 0000000..bc95c0f
Binary files /dev/null and b/basis/images/testing/bmp/rgb8bit.bmp differ
diff --git a/basis/images/testing/bmp/thiswayup24.bmp b/basis/images/testing/bmp/thiswayup24.bmp
new file mode 100644 (file)
index 0000000..202fb15
Binary files /dev/null and b/basis/images/testing/bmp/thiswayup24.bmp differ
diff --git a/basis/images/testing/gif/alpha.gif b/basis/images/testing/gif/alpha.gif
new file mode 100644 (file)
index 0000000..c4c38bd
Binary files /dev/null and b/basis/images/testing/gif/alpha.gif differ
diff --git a/basis/images/testing/gif/astronaut_animation.gif b/basis/images/testing/gif/astronaut_animation.gif
new file mode 100644 (file)
index 0000000..8c76848
Binary files /dev/null and b/basis/images/testing/gif/astronaut_animation.gif differ
diff --git a/basis/images/testing/gif/checkmark.gif b/basis/images/testing/gif/checkmark.gif
new file mode 100644 (file)
index 0000000..df83efa
Binary files /dev/null and b/basis/images/testing/gif/checkmark.gif differ
diff --git a/basis/images/testing/gif/circle.gif b/basis/images/testing/gif/circle.gif
new file mode 100644 (file)
index 0000000..101a48a
Binary files /dev/null and b/basis/images/testing/gif/circle.gif differ
diff --git a/basis/images/testing/gif/monochrome.gif b/basis/images/testing/gif/monochrome.gif
new file mode 100644 (file)
index 0000000..b0875fa
Binary files /dev/null and b/basis/images/testing/gif/monochrome.gif differ
diff --git a/basis/images/testing/gif/noise.gif b/basis/images/testing/gif/noise.gif
new file mode 100644 (file)
index 0000000..31dffae
Binary files /dev/null and b/basis/images/testing/gif/noise.gif differ
diff --git a/basis/images/testing/pam/rgb1x1.pam b/basis/images/testing/pam/rgb1x1.pam
new file mode 100644 (file)
index 0000000..412d9e7
Binary files /dev/null and b/basis/images/testing/pam/rgb1x1.pam differ
diff --git a/basis/images/testing/pam/rgb2x2.pam b/basis/images/testing/pam/rgb2x2.pam
new file mode 100644 (file)
index 0000000..70bed6e
Binary files /dev/null and b/basis/images/testing/pam/rgb2x2.pam differ
diff --git a/basis/images/testing/pam/rgb3x3.pam b/basis/images/testing/pam/rgb3x3.pam
new file mode 100644 (file)
index 0000000..dc45e4f
Binary files /dev/null and b/basis/images/testing/pam/rgb3x3.pam differ
diff --git a/basis/images/testing/pam/rgba1x1.pam b/basis/images/testing/pam/rgba1x1.pam
new file mode 100644 (file)
index 0000000..0387e9c
Binary files /dev/null and b/basis/images/testing/pam/rgba1x1.pam differ
diff --git a/basis/images/testing/pam/rgba2x2.pam b/basis/images/testing/pam/rgba2x2.pam
new file mode 100644 (file)
index 0000000..fabbff1
Binary files /dev/null and b/basis/images/testing/pam/rgba2x2.pam differ
diff --git a/basis/images/testing/pam/rgba3x3.pam b/basis/images/testing/pam/rgba3x3.pam
new file mode 100644 (file)
index 0000000..3dd52ad
Binary files /dev/null and b/basis/images/testing/pam/rgba3x3.pam differ
diff --git a/basis/images/testing/png/rgb.png b/basis/images/testing/png/rgb.png
new file mode 100755 (executable)
index 0000000..d34914a
Binary files /dev/null and b/basis/images/testing/png/rgb.png differ
diff --git a/basis/images/testing/png/yin_yang.png b/basis/images/testing/png/yin_yang.png
new file mode 100644 (file)
index 0000000..16d4ad0
Binary files /dev/null and b/basis/images/testing/png/yin_yang.png differ
diff --git a/basis/images/testing/testing.factor b/basis/images/testing/testing.factor
new file mode 100644 (file)
index 0000000..5c715b0
--- /dev/null
@@ -0,0 +1,13 @@
+! Copyright (C) 2009 Keith Lazuka.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io io.encodings.binary io.files
+io.streams.byte-array kernel quotations sequences tools.test ;
+IN: images.testing
+
+:: encode-test ( path image-class -- )
+    path binary file-contents 1quotation
+    [
+        binary <byte-writer> dup [
+            path load-image image-class image>stream
+        ] with-output-stream B{ } like
+    ] unit-test ;
diff --git a/basis/images/testing/tiff/alpha.tiff b/basis/images/testing/tiff/alpha.tiff
new file mode 100644 (file)
index 0000000..27215d6
Binary files /dev/null and b/basis/images/testing/tiff/alpha.tiff differ
diff --git a/basis/images/testing/tiff/color_spectrum.tiff b/basis/images/testing/tiff/color_spectrum.tiff
new file mode 100644 (file)
index 0000000..f596deb
Binary files /dev/null and b/basis/images/testing/tiff/color_spectrum.tiff differ
diff --git a/basis/images/testing/tiff/elephants.tiff b/basis/images/testing/tiff/elephants.tiff
new file mode 100644 (file)
index 0000000..f462a0c
Binary files /dev/null and b/basis/images/testing/tiff/elephants.tiff differ
diff --git a/basis/images/testing/tiff/noise.tiff b/basis/images/testing/tiff/noise.tiff
new file mode 100644 (file)
index 0000000..2958b0b
Binary files /dev/null and b/basis/images/testing/tiff/noise.tiff differ
diff --git a/basis/images/testing/tiff/octagon.tiff b/basis/images/testing/tiff/octagon.tiff
new file mode 100644 (file)
index 0000000..2b4ba39
Binary files /dev/null and b/basis/images/testing/tiff/octagon.tiff differ
diff --git a/basis/images/testing/tiff/rgb.tiff b/basis/images/testing/tiff/rgb.tiff
new file mode 100755 (executable)
index 0000000..71cbaa9
Binary files /dev/null and b/basis/images/testing/tiff/rgb.tiff differ
diff --git a/extra/images/pam/pam-tests.factor b/extra/images/pam/pam-tests.factor
new file mode 100644 (file)
index 0000000..e8d52f8
--- /dev/null
@@ -0,0 +1,57 @@
+! Copyright (C) 2009 Keith Lazuka.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors byte-arrays images.loader images.pam
+images.testing io io.encodings.binary io.files
+io.streams.byte-array kernel quotations tools.test ;
+IN: images.pam.tests
+
+! ----------- Encoder Tests ------------------------------
+
+"vocab:images/testing/pam/rgb1x1.pam" pam-image encode-test
+"vocab:images/testing/pam/rgba1x1.pam" pam-image encode-test
+"vocab:images/testing/pam/rgb2x2.pam" pam-image encode-test
+"vocab:images/testing/pam/rgba2x2.pam" pam-image encode-test
+"vocab:images/testing/pam/rgb3x3.pam" pam-image encode-test
+"vocab:images/testing/pam/rgba3x3.pam" pam-image encode-test
+
+! ----------- Decoder Tests ------------------------------
+
+! 1x1
+
+[ { 1 1 } ] [ "vocab:images/testing/pam/rgb1x1.pam" load-image dim>> ] unit-test
+
+[ B{ 0 0 0 } ]
+[ "vocab:images/testing/pam/rgb1x1.pam" load-image bitmap>> ] unit-test
+
+[ B{ 0 0 0 0 } ]
+[ "vocab:images/testing/pam/rgba1x1.pam" load-image bitmap>> ] unit-test
+
+! 2x2
+
+[ { 2  2 } ] [ "vocab:images/testing/pam/rgb2x2.pam" load-image dim>> ] unit-test
+
+[ B{ 0 0 0 255 255 255 255 255 255 0 0 0 } ]
+[ "vocab:images/testing/pam/rgb2x2.pam" load-image bitmap>> ] unit-test
+
+[ B{ 0 0 0 255 255 255 255 0 255 255 255 0 0 0 0 255 } ]
+[ "vocab:images/testing/pam/rgba2x2.pam" load-image bitmap>> ] unit-test
+
+! 3x3
+
+[
+    B{
+        255   0   0       0 255   0       0   0 255
+          4 252 253     254   1 127     252 253   2
+        255 255 255       0   0   0     255 255 255
+    }
+]
+[ "vocab:images/testing/pam/rgb3x3.pam" load-image bitmap>> ] unit-test
+
+[
+    B{
+        255   0   0 255       0 255   0 255       0   0 255 255
+          4 252 253 255     254   1 127 255     252 253   2 255
+        255 255 255 255       0   0   0 255     255 255 255   0
+    }
+]
+[ "vocab:images/testing/pam/rgba3x3.pam" load-image bitmap>> ] unit-test
diff --git a/extra/images/testing/alpha.gif b/extra/images/testing/alpha.gif
deleted file mode 100644 (file)
index c4c38bd..0000000
Binary files a/extra/images/testing/alpha.gif and /dev/null differ
diff --git a/extra/images/testing/alpha.tiff b/extra/images/testing/alpha.tiff
deleted file mode 100644 (file)
index 27215d6..0000000
Binary files a/extra/images/testing/alpha.tiff and /dev/null differ
diff --git a/extra/images/testing/astronaut_animation.gif b/extra/images/testing/astronaut_animation.gif
deleted file mode 100644 (file)
index 8c76848..0000000
Binary files a/extra/images/testing/astronaut_animation.gif and /dev/null differ
diff --git a/extra/images/testing/bi.tiff b/extra/images/testing/bi.tiff
deleted file mode 100644 (file)
index ad0ce97..0000000
Binary files a/extra/images/testing/bi.tiff and /dev/null differ
diff --git a/extra/images/testing/checkmark.gif b/extra/images/testing/checkmark.gif
deleted file mode 100644 (file)
index df83efa..0000000
Binary files a/extra/images/testing/checkmark.gif and /dev/null differ
diff --git a/extra/images/testing/circle.gif b/extra/images/testing/circle.gif
deleted file mode 100644 (file)
index 101a48a..0000000
Binary files a/extra/images/testing/circle.gif and /dev/null differ
diff --git a/extra/images/testing/color_spectrum.tiff b/extra/images/testing/color_spectrum.tiff
deleted file mode 100644 (file)
index f596deb..0000000
Binary files a/extra/images/testing/color_spectrum.tiff and /dev/null differ
diff --git a/extra/images/testing/cube.tiff b/extra/images/testing/cube.tiff
deleted file mode 100644 (file)
index eef52e3..0000000
Binary files a/extra/images/testing/cube.tiff and /dev/null differ
diff --git a/extra/images/testing/monochrome.gif b/extra/images/testing/monochrome.gif
deleted file mode 100644 (file)
index b0875fa..0000000
Binary files a/extra/images/testing/monochrome.gif and /dev/null differ
diff --git a/extra/images/testing/noise.bmp b/extra/images/testing/noise.bmp
deleted file mode 100644 (file)
index 8e47f14..0000000
Binary files a/extra/images/testing/noise.bmp and /dev/null differ
diff --git a/extra/images/testing/noise.gif b/extra/images/testing/noise.gif
deleted file mode 100644 (file)
index 31dffae..0000000
Binary files a/extra/images/testing/noise.gif and /dev/null differ
diff --git a/extra/images/testing/noise.tiff b/extra/images/testing/noise.tiff
deleted file mode 100644 (file)
index 2958b0b..0000000
Binary files a/extra/images/testing/noise.tiff and /dev/null differ
diff --git a/extra/images/testing/small.tiff b/extra/images/testing/small.tiff
deleted file mode 100644 (file)
index 7051d58..0000000
Binary files a/extra/images/testing/small.tiff and /dev/null differ
diff --git a/extra/images/testing/square.tiff b/extra/images/testing/square.tiff
deleted file mode 100644 (file)
index 16e94f7..0000000
Binary files a/extra/images/testing/square.tiff and /dev/null differ