Skip to content

Commit

Permalink
Make the glx_alias_prefer_same_name test work, and hook it up.
Browse files Browse the repository at this point in the history
Apparently I started writing it, and didn't notice I wasn't building
my code when I committed the library support.
  • Loading branch information
anholt committed Jul 16, 2015
1 parent c8cd4b7 commit 8bbc0d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ egl_and_glx_different_pointers_egl_glx_LDADD = libegl_common.la libglx_common.la
egl_and_glx_different_pointers_egl_glx_LDFLAGS = -rdynamic
egl_and_glx_different_pointers_egl_glx_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_EGL -DUSE_GLX

glx_alias_prefer_same_name_SOURCES = glx_gles2.c dlwrap.c dlwrap.h
glx_alias_prefer_same_name_SOURCES = glx_alias_prefer_same_name.c dlwrap.c dlwrap.h
glx_alias_prefer_same_name_LDFLAGS = -rdynamic
glx_alias_prefer_same_name_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) -ldl

Expand Down
25 changes: 7 additions & 18 deletions test/glx_alias_prefer_same_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ static int last_call;
#define EXT_FUNC_VAL 101

void
override_GL_glBindTexture(GLenum target, GLenum texture);
override_GL_glBindTexture(GLenum target);
void
override_GL_glBindTextureEXT(GLenum target, GLenum texture);
override_GL_glBindTextureEXT(GLenum target);

void
override_GL_glBindTexture(GLenum target)
Expand All @@ -57,7 +57,7 @@ override_GL_glBindTexture(GLenum target)
}

void
override_GL_glBindTexture(GLenum target)
override_GL_glBindTextureEXT(GLenum target)
{
last_call = EXT_FUNC_VAL;
}
Expand All @@ -66,28 +66,17 @@ int
main(int argc, char **argv)
{
bool pass = true;
XVisualInfo *vis;
Window win;
GLXContext ctx;
GLXFBConfig config;
int context_attribs[] = {
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
GLX_CONTEXT_MAJOR_VERSION_ARB, 2,
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
0
};
GLuint shader;

dpy = get_display_or_skip();
make_glx_context_current_or_skip(dpy);

if (!epoxy_has_gl_extension(dpy, 0, "GLX_EXT_texture_object"))
errx(77, "Test requires GLX_EXT_texture_object");
if (!epoxy_has_gl_extension("GL_EXT_texture_object"))
errx(77, "Test requires GL_EXT_texture_object");

glBindTexture(GL_TEXTURE_2D, 1);
pass = pass && last_call == CORE_VAL;
pass = pass && last_call == CORE_FUNC_VAL;
glBindTextureEXT(GL_TEXTURE_2D, 1);
pass = pass && last_call == EXT_VAL;
pass = pass && last_call == EXT_FUNC_VAL;

return pass != true;
}

0 comments on commit 8bbc0d4

Please sign in to comment.