From 2cc8bf0ac572a857ab01ebec3aa4977ddfec8fe9 Mon Sep 17 00:00:00 2001 From: David Eberlein Date: Thu, 18 Apr 2013 10:23:31 +0200 Subject: [PATCH] BUGFIX: Fixed test not running die to OS differences. Now the edge pixels arn't checked anymore which works fine on linux and windows. --- auto_tests/tests/grid_per_axis.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/auto_tests/tests/grid_per_axis.js b/auto_tests/tests/grid_per_axis.js index 8f3d1b3..e5c960f 100644 --- a/auto_tests/tests/grid_per_axis.js +++ b/auto_tests/tests/grid_per_axis.js @@ -270,7 +270,7 @@ GridPerAxisTestCase.prototype.testGridLinePattern = function() { axes : { y : { gridLineColor : "#0000ff", - gridLinePattern : [ 4, 4 ] + gridLinePattern : [ 10, 10 ] } } }; @@ -295,9 +295,13 @@ GridPerAxisTestCase.prototype.testGridLinePattern = function() { y = halfDown(g.toDomYCoord(yGridlines[i], 0)); // Step through the pixels of the line and test the pattern. for (x = halfUp(g.plotter_.area.x); x < g.plotter_.area.w; x++) { + // avoid checking the edge pixels since they differ depending on the OS. + var pixelpos = x % 10; + if(pixelpos < 1 || pixelpos > 8) continue; + // Ignore alpha var drawnPixel = Util.samplePixel(g.hidden_, x, y).slice(0,3); - var pattern = (Math.floor((x) / 4)) % 2; + var pattern = (Math.floor((x) / 10)) % 2; switch (pattern) { case 0: // fill assertEquals("Unexpected filled grid-pattern color found at pixel: x: " + x + "y: " -- 2.7.4