diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-02 15:50:56 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-02 15:50:56 -0700 |
commit | c22a3398a4fd8e495898e9dfaba4e15f47d1630f (patch) | |
tree | 25608e73a0cb493914f203a00198bfc518c6efd8 | |
parent | 2cb37d3818ce1acbc074e0a545b588ba41aee332 (diff) |
convert test_cubegeom_pre to reftest
-rw-r--r-- | tests/cubegeom_pre.c | 17 | ||||
-rw-r--r-- | tests/cubegeom_pre.png | bin | 0 -> 173408 bytes | |||
-rwxr-xr-x | tests/runner.py | 3 |
3 files changed, 3 insertions, 17 deletions
diff --git a/tests/cubegeom_pre.c b/tests/cubegeom_pre.c index 8001a2b8..fb1a5e02 100644 --- a/tests/cubegeom_pre.c +++ b/tests/cubegeom_pre.c @@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE. #include <string.h> #include <assert.h> -void verify() { - int width = 640, height = 480; - unsigned char *data = (unsigned char*)malloc(width*height*4); - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); - int sum = 0; - for (int x = 0; x < width*height*4; x++) { - if (x % 4 != 3) sum += x * data[x]; - } -#if EMSCRIPTEN - int result = sum; - REPORT_RESULT(); -#endif -} - int main(int argc, char *argv[]) { SDL_Surface *screen; @@ -295,8 +281,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); - verify(); - + #if !EMSCRIPTEN SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre.png b/tests/cubegeom_pre.png Binary files differnew file mode 100644 index 00000000..0a8c95cb --- /dev/null +++ b/tests/cubegeom_pre.png diff --git a/tests/runner.py b/tests/runner.py index 61fde26f..9e1e6707 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -12417,6 +12417,7 @@ elif 'browser' in str(sys.argv): var actualUrl = Module.canvas.toDataURL(); var actualImage = new Image(); actualImage.onload = function() { + //document.body.appendChild(actualImage); // to grab it for creating the test reference var actualCanvas = document.createElement('canvas'); actualCanvas.width = actualImage.width; actualCanvas.height = actualImage.height; @@ -13604,7 +13605,7 @@ Press any key to continue.''' self.btest('gl_matrix_identity.c', expected=['-1882984448', '460451840']) def test_cubegeom_pre(self): - self.btest('cubegeom_pre.c', expected=['-1472804742', '-1626058463', '-2046234971']) + self.btest('cubegeom_pre.c', reference='cubegeom_pre.png') def test_cubegeom_pre2(self): self.btest('cubegeom_pre2.c', expected=['-1472804742', '-1626058463', '-2046234971'], args=['-s', 'GL_DEBUG=1']) # some coverage for GL_DEBUG not breaking the build |