From e86ff2a3128f4a0157ecfa10fee31d1416312c71 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 5 Dec 2008 14:19:25 +0000 Subject: [PATCH] opengl/tests: Skip tests if we can't find a pixel format. --- dlls/opengl32/tests/opengl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 35eb8ae83cf..a3ac3af7e6d 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -555,7 +555,12 @@ START_TEST(opengl) hdc = GetDC(hwnd); iPixelFormat = ChoosePixelFormat(hdc, &pfd); - ok(iPixelFormat > 0, "No pixelformat found!\n"); /* This should never happen as ChoosePixelFormat always returns a closest match */ + if(iPixelFormat == 0) + { + /* This should never happen as ChoosePixelFormat always returns a closest match, but currently this fails in Wine if we don't have glX */ + win_skip("Unable to find pixel format.\n"); + goto cleanup; + } /* We shouldn't be able to create a context from a hdc which doesn't have a pixel format set */ hglrc = wglCreateContext(hdc); @@ -615,6 +620,8 @@ START_TEST(opengl) else trace("WGL_ARB_pbuffer not supported, skipping pbuffer test\n"); +cleanup: + ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); } }