summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFreeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace>2013-06-28 17:35:39 +1200
committerFreeyorp <TheFreeYorp@NOSPAM.G.m.a.i.l.replace>2013-06-28 17:38:21 +1200
commit15462cc5f1ed02c0614476bf85de66edeec98801 (patch)
tree0aca72454e8666496ca8c309b3dde00cbfc1cf15 /test
parent8303d21f2d44769e0400a34d2e3c32db20e44d9e (diff)
downloadmanaportal-15462cc5f1ed02c0614476bf85de66edeec98801.tar.gz
manaportal-15462cc5f1ed02c0614476bf85de66edeec98801.tar.bz2
manaportal-15462cc5f1ed02c0614476bf85de66edeec98801.tar.xz
manaportal-15462cc5f1ed02c0614476bf85de66edeec98801.zip
Add test for the full colorspace of each channel
Diffstat (limited to 'test')
-rw-r--r--test/data/gradient-whitecakedye.pngbin0 -> 3953 bytes
-rw-r--r--test/data/gradient.pngbin0 -> 4615 bytes
-rw-r--r--test/mp/future.js23
3 files changed, 15 insertions, 8 deletions
diff --git a/test/data/gradient-whitecakedye.png b/test/data/gradient-whitecakedye.png
new file mode 100644
index 0000000..248e404
--- /dev/null
+++ b/test/data/gradient-whitecakedye.png
Binary files differ
diff --git a/test/data/gradient.png b/test/data/gradient.png
new file mode 100644
index 0000000..734ac7c
--- /dev/null
+++ b/test/data/gradient.png
Binary files differ
diff --git a/test/mp/future.js b/test/mp/future.js
index cf0e68a..3d47c28 100644
--- a/test/mp/future.js
+++ b/test/mp/future.js
@@ -50,6 +50,14 @@ function unshiftLoadImageBind(url, tests) {
return tests;
}
+function testDye(err, dyed, dyeable, mp) {
+ var input = dyeable.data;
+ var expected = dyed.data;
+ var actual = new Uint8ClampedArray(input);
+ mp.dye.dyeImage(actual, dyeData);
+ assertImageDataEqual(input, expected, actual, dyed.width);
+}
+
suite.addBatch({
"The manaportal dye": {
topic: load("mp/dye", "mp/resource").expression("mp").document(),
@@ -60,14 +68,13 @@ suite.addBatch({
},
"dyeImage": {
"with the big recolorable cake": unshiftLoadImageBind("test/data/bigcake.png", {
- "to the big white cake": unshiftLoadImageBind("test/data/whitecake.png", {
- "dyes correctly when given the correct dye data": function(err, whiteCake, dyeableCake, mp) {
- var input = dyeableCake.data;
- var expected = whiteCake.data;
- var actual = new Uint8ClampedArray(input);
- mp.dye.dyeImage(actual, dyeData);
- assertImageDataEqual(input, expected, actual, whiteCake.width);
- }
+ "to the big white cake dyed by TMWW": unshiftLoadImageBind("test/data/whitecake.png", {
+ "dyes correctly when given the correct dye data": testDye
+ })
+ }),
+ "with a gradient of all channels with all intensities": unshiftLoadImageBind("test/data/gradient.png", {
+ "to a gradient of all channels with all intensities dyed by TMWW with the white cake dye": unshiftLoadImageBind("test/data/gradient-whitecakedye.png", {
+ "dyes correctly when given the correct dye data": testDye
})
})
}