aboutsummaryrefslogtreecommitdiff
path: root/tests/test_browser.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-08 19:44:38 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-08 19:44:38 -0800
commit2ab9b016dcb2df413a62e10c3297ea195c7530d1 (patch)
tree75c7a4cae21cbeb5a28f378f7ba38adf8f17498f /tests/test_browser.py
parent157f3151a43e02b6c335c312a3f78bac0d0110eb (diff)
add test for getProcAddress that requires we allow collisions in the main namespace with gl* functions
Diffstat (limited to 'tests/test_browser.py')
-rw-r--r--tests/test_browser.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_browser.py b/tests/test_browser.py
index ef67aa20..fe0ffdd2 100644
--- a/tests/test_browser.py
+++ b/tests/test_browser.py
@@ -1537,6 +1537,20 @@ keydown(100);keyup(100); // trigger the end
def test_cubegeom(self):
self.btest('cubegeom.c', reference='cubegeom.png', args=['-O2', '-g', '-s', 'LEGACY_GL_EMULATION=1'])
+ def test_cubegeom_proc(self):
+ open('side.c', 'w').write(r'''
+
+extern void* SDL_GL_GetProcAddress(const char *);
+
+void *glBindBuffer = 0; // same name as the gl function, to check that the collision does not break us
+
+void *getBindBuffer() {
+ if (!glBindBuffer) glBindBuffer = SDL_GL_GetProcAddress("glBindBuffer");
+ return glBindBuffer;
+}
+''')
+ self.btest('cubegeom_proc.c', reference='cubegeom.png', args=['side.c', '-s', 'LEGACY_GL_EMULATION=1'])
+
def test_cubegeom_glew(self):
self.btest('cubegeom_glew.c', reference='cubegeom.png', args=['-O2', '--closure', '1', '-s', 'LEGACY_GL_EMULATION=1'])