Module: wine
Branch: master
Commit: 1d49ceaa502084221d56be7e3cbddaa7f6233b96
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1d49ceaa502084221d56be7e…
Author: Alex Henrie <alexhenrie24(a)gmail.com>
Date: Mon Sep 3 22:28:11 2018 -0600
opengl/tests: Don't run Pbuffer tests if no Pbuffer can be created.
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/opengl32/tests/opengl.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index b69d91c..8105201 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -194,17 +194,18 @@ static void test_pbuffers(HDC hdc)
{
HDC pbuffer_hdc;
HPBUFFERARB pbuffer = pwglCreatePbufferARB(hdc, iPixelFormat, 640 /* width */, 480 /* height */, NULL);
- if(!pbuffer)
- skip("Pbuffer creation failed!\n");
-
- /* Test the pixelformat returned by GetPixelFormat on a pbuffer as the behavior is not clear */
- pbuffer_hdc = pwglGetPbufferDCARB(pbuffer);
- res = GetPixelFormat(pbuffer_hdc);
-
- ok(res == 1, "Unexpected iPixelFormat=%d (1 expected) returned by GetPixelFormat for offscreen format %d\n", res, iPixelFormat);
- trace("iPixelFormat returned by GetPixelFormat: %d\n", res);
- trace("PixelFormat from wglChoosePixelFormatARB: %d\n", iPixelFormat);
- pwglReleasePbufferDCARB(pbuffer, hdc);
+ if(pbuffer)
+ {
+ /* Test the pixelformat returned by GetPixelFormat on a pbuffer as the behavior is not clear */
+ pbuffer_hdc = pwglGetPbufferDCARB(pbuffer);
+ res = GetPixelFormat(pbuffer_hdc);
+
+ ok(res == 1, "Unexpected iPixelFormat=%d (1 expected) returned by GetPixelFormat for offscreen format %d\n", res, iPixelFormat);
+ trace("iPixelFormat returned by GetPixelFormat: %d\n", res);
+ trace("PixelFormat from wglChoosePixelFormatARB: %d\n", iPixelFormat);
+ pwglReleasePbufferDCARB(pbuffer, hdc);
+ }
+ else skip("Pbuffer creation failed!\n");
}
else skip("Pbuffer test for offscreen pixelformat skipped as no offscreen-only format with pbuffer capabilities has been found\n");
}