Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions test/gl_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
*/

#include <assert.h>
#include <emscripten.h>
#include <emscripten/html5.h>
#include <GL/gl.h>
#include <stdio.h>
#include <string.h>
Expand All @@ -21,10 +19,17 @@ int main() {
screen = SDL_SetVideoMode( 256, 256, 16, SDL_OPENGL );
assert(screen);

// pop from empty stack
// glGetError again should return 0 initially
assert(glGetError() == 0);

// pop from empty stack, causing an underflow error
glPopMatrix();
assert(glGetError() == GL_STACK_UNDERFLOW);
GLenum err = glGetError();
printf("glGetError -> %d\n", err);
assert(err == GL_STACK_UNDERFLOW);

// Calling glGetError again should report no error.
assert(glGetError() == 0);

REPORT_RESULT(1);
return 0;
}
2 changes: 1 addition & 1 deletion test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ def test_perspective(self):

@requires_graphics_hardware
def test_glerror(self):
self.btest('gl_error.c', expected='1', cflags=['-sLEGACY_GL_EMULATION', '-lGL'])
self.btest_exit('gl_error.c', cflags=['-sLEGACY_GL_EMULATION', '-lGL'])

@parameterized({
'': ([],),
Expand Down