diff options
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/tests/runner.py b/tests/runner.py index ed7e18c9..baa9eb5e 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7842,11 +7842,13 @@ elif 'browser' in str(sys.argv): var actual = actualCtx.getImageData(0, 0, actualImage.width, actualImage.height).data; var total = 0; - for (var x = 0; x < img.width; x++) { - for (var y = 0; y < img.height; y++) { - total += Math.abs(expected[y*img.width*4 + x*4 + 0] - actual[y*img.width*4 + x*4 + 0]); - total += Math.abs(expected[y*img.width*4 + x*4 + 1] - actual[y*img.width*4 + x*4 + 1]); - total += Math.abs(expected[y*img.width*4 + x*4 + 2] - actual[y*img.width*4 + x*4 + 2]); + var width = img.width; + var height = img.height; + for (var x = 0; x < width; x++) { + for (var y = 0; y < height; y++) { + total += Math.abs(expected[y*width*4 + x*4 + 0] - actual[y*width*4 + x*4 + 0]); + total += Math.abs(expected[y*width*4 + x*4 + 1] - actual[y*width*4 + x*4 + 1]); + total += Math.abs(expected[y*width*4 + x*4 + 2] - actual[y*width*4 + x*4 + 2]); } } var wrong = Math.floor(total / (img.width*img.height*3)); // floor, to allow some margin of error for antialiasing @@ -8331,52 +8333,52 @@ elif 'browser' in str(sys.argv): self.btest('gl_matrix_identity.c', expected=['-1882984448', '460451840']) def test_cubegeom_pre(self): - self.btest('cubegeom_pre.c', expected='-1472804742') + self.btest('cubegeom_pre.c', expected=['-1472804742', '-1626058463']) def test_cubegeom_pre2(self): - self.btest('cubegeom_pre2.c', expected='-1472804742', args=['-s', 'GL_DEBUG=1']) # some coverage for GL_DEBUG not breaking the build + self.btest('cubegeom_pre2.c', expected=['-1472804742', '-1626058463'], args=['-s', 'GL_DEBUG=1']) # some coverage for GL_DEBUG not breaking the build def test_cubegeom_pre3(self): - self.btest('cubegeom_pre3.c', expected='-1472804742') + self.btest('cubegeom_pre3.c', expected=['-1472804742', '-1626058463']) def test_cubegeom(self): - self.btest('cubegeom.c', expected=['188641320', '1522377227']) + self.btest('cubegeom.c', expected=['188641320', '1522377227', '-1054007155']) def test_cubegeom_color(self): - self.btest('cubegeom_color.c', expected='588472350') + self.btest('cubegeom_color.c', expected=['588472350', '-687660609']) def test_cubegeom_normal(self): - self.btest('cubegeom_normal.c', expected='752917084') + self.btest('cubegeom_normal.c', expected=['752917084', '-251570256']) def test_cubegeom_normal_dap(self): # draw is given a direct pointer to clientside memory, no element array buffer - self.btest('cubegeom_normal_dap.c', expected='752917084') + self.btest('cubegeom_normal_dap.c', expected=['752917084', '-251570256']) def test_cubegeom_normal_dap_far(self): # indices do nto start from 0 - self.btest('cubegeom_normal_dap_far.c', expected='752917084') + self.btest('cubegeom_normal_dap_far.c', expected=['752917084', '-251570256']) def test_cubegeom_normal_dap_far_range(self): # glDrawRangeElements - self.btest('cubegeom_normal_dap_far_range.c', expected='752917084') + self.btest('cubegeom_normal_dap_far_range.c', expected=['752917084', '-251570256']) def test_cubegeom_normal_dap_far_glda(self): # use glDrawArrays - self.btest('cubegeom_normal_dap_far_glda.c', expected='-218745386') + self.btest('cubegeom_normal_dap_far_glda.c', expected=['-218745386', '-263951846']) def test_cubegeom_normal_dap_far_glda_quad(self): # with quad - self.btest('cubegeom_normal_dap_far_glda_quad.c', expected='1757386625') + self.btest('cubegeom_normal_dap_far_glda_quad.c', expected=['1757386625', '-677777235']) def test_cubegeom_mt(self): - self.btest('cubegeom_mt.c', expected='-457159152') # multitexture + self.btest('cubegeom_mt.c', expected=['-457159152', '910983047']) # multitexture def test_cubegeom_color2(self): - self.btest('cubegeom_color2.c', expected='1121999515') + self.btest('cubegeom_color2.c', expected=['1121999515', '-391668088']) def test_cubegeom_texturematrix(self): - self.btest('cubegeom_texturematrix.c', expected='1297500583') + self.btest('cubegeom_texturematrix.c', expected=['1297500583', '-791216738']) def test_cubegeom_fog(self): - self.btest('cubegeom_fog.c', expected='1617140399') + self.btest('cubegeom_fog.c', expected=['1617140399', '-898782526']) def test_cube_explosion(self): - self.btest('cube_explosion.c', expected='667220544') + self.btest('cube_explosion.c', expected=['667220544', '-1543354600']) def test_sdl_canvas_palette(self): self.btest('sdl_canvas_palette.c', reference='sdl_canvas_palette.png') @@ -8404,7 +8406,7 @@ elif 'browser' in str(sys.argv): shutil.move('ship.dds', 'ship.donotfindme.dds') # make sure we load from the compressed shutil.move('bloom.dds', 'bloom.donotfindme.dds') # make sure we load from the compressed shutil.move('water.dds', 'water.donotfindme.dds') # make sure we load from the compressed - self.btest('s3tc_crunch.c', reference='s3tc_crunch.png', args=['--pre-js', 'pre.js']) + self.btest('s3tc_crunch.c', reference='s3tc_crunch.png', reference_slack=1, args=['--pre-js', 'pre.js']) def test_aniso(self): shutil.copyfile(path_from_root('tests', 'water.dds'), 'water.dds') |