diff options
-rw-r--r-- | tests/cubegeom.c | 18 | ||||
-rwxr-xr-x | tests/runner.py | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/cubegeom.c b/tests/cubegeom.c index 529e1355..17d6e909 100644 --- a/tests/cubegeom.c +++ b/tests/cubegeom.c @@ -29,6 +29,20 @@ 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; @@ -267,7 +281,9 @@ int main(int argc, char *argv[]) // END SDL_GL_SwapBuffers(); - + + verify(); + #if !EMSCRIPTEN SDL_Delay(3000); #endif diff --git a/tests/runner.py b/tests/runner.py index c9831180..143587a0 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7238,8 +7238,8 @@ elif 'browser' in str(sys.argv): def test_cubegeom_pre3(self): self.btest('cubegeom_pre3.c', expected='-1472804742', args=['-s', 'GL_DEBUG=1']) - def zzztest_cubegeom(self): - self.btest('cubegeom.c', reference='sdlglshader.png', args=['-s', 'GL_DEBUG=1']) + def test_cubegeom(self): + self.btest('cubegeom.c', expected='-1402263178') elif 'benchmark' in str(sys.argv): # Benchmarks. Run them with argument |benchmark|. To run a specific test, do |