diff --git a/tests/Makefile.am b/tests/Makefile.am index 2063f8a..d17a17d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -107,7 +107,8 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/util/glvnd_pthread -testglxgetprocaddress_LDADD = $(top_builddir)/src/GLX/libGLX.la +testglxgetprocaddress_LDADD = -lX11 +testglxgetprocaddress_LDADD += $(top_builddir)/src/GLX/libGLX.la testglxmakecurrent_LDADD = -lX11 testglxmakecurrent_LDADD += $(top_builddir)/src/GLX/libGLX.la diff --git a/tests/testglxgetprocaddress.c b/tests/testglxgetprocaddress.c index 71fa263..d588070 100644 --- a/tests/testglxgetprocaddress.c +++ b/tests/testglxgetprocaddress.c @@ -65,6 +65,8 @@ PROC_DEFINES(void, OogaBooga, (int a, int b, int c)); int main(int argc, char **argv) { + Display *dpy = NULL; + int retval = 0; /* * Try GetProcAddress on different classes of API functions, and bogus @@ -73,6 +75,12 @@ int main(int argc, char **argv) * to no-ops. */ + dpy = XOpenDisplay(NULL); + if (dpy == NULL) { + printf("Can't open display\n"); + goto fail; + } + /* * Test core GLX dispatch functions implemented by API library. This * simply returns the symbol exported by libGLX. @@ -87,7 +95,7 @@ int main(int argc, char **argv) * (a zero value indicates we might be calling into a no-op stub generated * by libGLdispatch). */ - CHECK_PROC(glXExampleExtensionFunction, (NULL, 0, &retval)); + CHECK_PROC(glXExampleExtensionFunction, (dpy, DefaultScreen(dpy), &retval)); if (!retval) { printf("Unexpected glXExampleExtensionFunction() return value!\n");