2009-02-09 21:57:26 -05:00
|
|
|
USING: images.bitmap images.viewer io.encodings.binary
|
2009-03-14 01:01:01 -04:00
|
|
|
io.files io.files.unique kernel tools.test images.loader
|
2009-04-09 11:44:50 -04:00
|
|
|
literals sequences checksums.md5 checksums
|
|
|
|
images.normalization ;
|
2009-02-09 21:57:26 -05:00
|
|
|
IN: images.bitmap.tests
|
|
|
|
|
2009-03-14 01:01:01 -04:00
|
|
|
CONSTANT: test-bitmap24 "vocab:images/test-images/thiswayup24.bmp"
|
2009-02-09 21:57:26 -05:00
|
|
|
|
2009-03-14 01:01:01 -04:00
|
|
|
CONSTANT: test-bitmap8 "vocab:images/test-images/rgb8bit.bmp"
|
2009-02-09 21:57:26 -05:00
|
|
|
|
2009-03-14 01:01:01 -04:00
|
|
|
CONSTANT: test-bitmap4 "vocab:images/test-images/rgb4bit.bmp"
|
2009-02-09 21:57:26 -05:00
|
|
|
|
2009-03-14 01:01:01 -04:00
|
|
|
CONSTANT: test-bitmap1 "vocab:images/test-images/1bit.bmp"
|
2009-02-09 21:57:26 -05:00
|
|
|
|
2009-04-08 19:42:01 -04:00
|
|
|
CONSTANT: test-40 "vocab:images/test-images/40red24bit.bmp"
|
|
|
|
CONSTANT: test-41 "vocab:images/test-images/41red24bit.bmp"
|
|
|
|
CONSTANT: test-42 "vocab:images/test-images/42red24bit.bmp"
|
|
|
|
CONSTANT: test-43 "vocab:images/test-images/43red24bit.bmp"
|
|
|
|
|
2009-03-14 01:01:01 -04:00
|
|
|
{
|
|
|
|
$ test-bitmap8
|
|
|
|
$ test-bitmap24
|
|
|
|
"vocab:ui/render/test/reference.bmp"
|
2009-04-08 19:42:01 -04:00
|
|
|
} [ [ ] swap [ load-image drop ] curry unit-test ] each
|
|
|
|
|
|
|
|
|
|
|
|
: test-bitmap-save ( path -- ? )
|
|
|
|
[ md5 checksum-file ]
|
2009-04-09 11:44:50 -04:00
|
|
|
[ load-image normalize-image ] bi
|
2009-04-08 19:42:01 -04:00
|
|
|
"bitmap-save-test" unique-file
|
|
|
|
[ save-bitmap ]
|
|
|
|
[ md5 checksum-file ] bi = ;
|
|
|
|
|
|
|
|
[
|
|
|
|
t
|
|
|
|
] [
|
|
|
|
{
|
|
|
|
$ test-40
|
|
|
|
$ test-41
|
|
|
|
$ test-42
|
|
|
|
$ test-43
|
2009-04-09 11:44:50 -04:00
|
|
|
$ test-bitmap24
|
2009-04-08 19:42:01 -04:00
|
|
|
} [ test-bitmap-save ] all?
|
|
|
|
] unit-test
|