From: David Adam Subject: ddraw: Add tests for SetCooperativeLevel Message-Id: Date: Sun, 29 May 2011 22:30:05 +0200
From 32758700ba6da97c89333b9418cef70c1084681b Mon Sep 17 00:00:00 2001 From: David Adam Date: Sun, 29 May 2011 22:24:06 +0200 Subject: Add tests for SetcooperativeLevel --- dlls/ddraw/tests/ddrawmodes.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c index 61f07fe..7c22ec2 100644 --- a/dlls/ddraw/tests/ddrawmodes.c +++ b/dlls/ddraw/tests/ddrawmodes.c @@ -946,6 +946,41 @@ static void testcooperativelevels_exclusive(void) /* All done */ } +static void testcooperativelevels_createdevicewindow(void) +{ + HRESULT rc; + + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_SETFOCUSWINDOW); + ok(rc==DD_OK || + broken(rc==DDERR_INVALIDPARAMS) /* NT4 */, "SetCooperativelevel(DDSCL_SETFOCUSWINDOW) returned: %x\n",rc); + if(rc==DD_OK) + { + rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + todo_wine ok(rc==DD_OK, "SetCooperativelevel(DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) returned: %x\n",rc); + } + + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_NORMAL); + ok(rc==DD_OK,"SetCooperativelevel(DDSCL_NORMAL) returned: %x\n",rc); + rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(rc==DDERR_INVALIDPARAMS,"SetCooperativelevel(DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) returned: %x\n",rc); + + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_NORMAL | DDSCL_FULLSCREEN); + ok(rc==DD_OK,"SetCooperativelevel(DDSCL_NORMAL | DDSCL_EXCLUSIVE) returned: %x\n",rc); + rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(rc==DDERR_INVALIDPARAMS,"SetCooperativelevel(DDSCL_CREATEDEVICEWINDOW | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) returned: %x\n",rc); + + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_NORMAL); + ok(rc==DD_OK,"SetCooperativelevel(DDSCL_NORMAL) returned: %x\n",rc); + rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); + todo_wine ok(rc==DDERR_INVALIDPARAMS,"SetCooperativelevel(DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL) returned: %x\n",rc); + + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_SETFOCUSWINDOW); + ok(rc==DD_OK || + broken(rc==DDERR_INVALIDPARAMS) /* NT4 */, "SetCooperativelevel(DDSCL_SETFOCUSWINDOW) returned: %x\n",rc); + rc = IDirectDraw_SetCooperativeLevel(lpDD, NULL, DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL); + todo_wine ok(rc==DDERR_INVALIDPARAMS,"SetCooperativelevel(DDSCL_CREATEDEVICEWINDOW | DDSCL_NORMAL) returned: %x\n",rc); +} + static void testddraw3(void) { const GUID My_IID_IDirectDraw3 = { @@ -1060,4 +1095,8 @@ START_TEST(ddrawmodes) createdirectdraw(); testcooperativelevels_exclusive(); releasedirectdraw(); + + createdirectdraw(); + testcooperativelevels_createdevicewindow(); + releasedirectdraw(); } -- 1.7.3.4