Paul Gofman : opengl32/tests: Add more tests for ChoosePixelFormat().
Alexandre Julliard
julliard at winehq.org
Wed Jun 22 16:12:09 CDT 2022
Module: wine
Branch: master
Commit: 83cbcdefa3f55afc449b6be51e215c4f646869f4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=83cbcdefa3f55afc449b6be51e215c4f646869f4
Author: Paul Gofman <pgofman at codeweavers.com>
Date: Tue Jun 21 10:29:18 2022 -0500
opengl32/tests: Add more tests for ChoosePixelFormat().
Test extended by Matteo Bruni.
---
dlls/opengl32/tests/opengl.c | 55 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index 8b0e70ccf9c..f05bb09d4b6 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -342,6 +342,61 @@ static void test_choosepixelformat(void)
pfd.cDepthBits = 0;
pfd.cStencilBits = 0;
pfd.dwFlags &= ~PFD_DEPTH_DONTCARE;
+
+ pfd.cDepthBits = 16;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 16 failed.\n" );
+ ok( ret_fmt.cDepthBits >= 16, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
+ pfd.cDepthBits = 0;
+
+ pfd.cDepthBits = 16;
+ pfd.cStencilBits = 8;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 16, stencil 8 failed.\n" );
+ ok( ret_fmt.cDepthBits >= 16, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
+ ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cDepthBits = 0;
+ pfd.cStencilBits = 0;
+
+ pfd.cDepthBits = 8;
+ pfd.cStencilBits = 8;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 8, stencil 8 failed.\n" );
+ ok( ret_fmt.cDepthBits >= 8, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
+ ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cDepthBits = 0;
+ pfd.cStencilBits = 0;
+
+ pfd.cDepthBits = 24;
+ pfd.cStencilBits = 8;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 24, stencil 8 failed.\n" );
+ ok( ret_fmt.cDepthBits >= 24, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
+ ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cDepthBits = 0;
+ pfd.cStencilBits = 0;
+
+ pfd.cDepthBits = 32;
+ pfd.cStencilBits = 8;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 32, stencil 8 failed.\n" );
+ ok( ret_fmt.cDepthBits >= 24, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
+ ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cDepthBits = 0;
+ pfd.cStencilBits = 0;
+
+ pfd.cDepthBits = 32;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 32, stencil 8 failed.\n" );
+ ok( ret_fmt.cDepthBits >= 24, "Got unexpected cDepthBits %u.\n", ret_fmt.cDepthBits );
+ ok( !ret_fmt.cStencilBits, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cDepthBits = 0;
+
+ pfd.cStencilBits = 8;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 32, stencil 8 failed.\n" );
+ ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cStencilBits = 0;
+
+ pfd.cDepthBits = 1;
+ pfd.cStencilBits = 8;
+ ok( test_pfd(&pfd, &ret_fmt), "depth 32, stencil 8 failed.\n" );
+ ok( ret_fmt.cStencilBits == 8, "Got unexpected cStencilBits %u.\n", ret_fmt.cStencilBits );
+ pfd.cStencilBits = 0;
+ pfd.cDepthBits = 0;
}
static void WINAPI gl_debug_message_callback(GLenum source, GLenum type, GLuint id, GLenum severity,
More information about the wine-cvs
mailing list