Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e79a6b20
Commit
e79a6b20
authored
Dec 16, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add tests for ddraw window proc handling.
parent
978e22a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
0 deletions
+97
-0
d3d.c
dlls/ddraw/tests/d3d.c
+97
-0
No files found.
dlls/ddraw/tests/d3d.c
View file @
e79a6b20
...
...
@@ -3077,6 +3077,101 @@ static void SetRenderTargetTest(void)
IDirectDrawSurface7_Release
(
newrt
);
}
static
UINT
expect_message
;
static
LRESULT
CALLBACK
test_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
expect_message
&&
message
==
expect_message
)
expect_message
=
0
;
return
DefWindowProcA
(
hwnd
,
message
,
wparam
,
lparam
);
}
static
void
test_wndproc
(
void
)
{
IDirectDraw7
*
ddraw7
;
WNDCLASSA
wc
=
{
0
};
LONG_PTR
proc
;
HWND
window
;
HRESULT
hr
;
ULONG
ref
;
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create IDirectDraw7 object (%#x), skipping tests.
\n
"
,
hr
);
return
;
}
wc
.
lpfnWndProc
=
test_proc
;
wc
.
lpszClassName
=
"d3d7_test_wndproc_wc"
;
ok
(
RegisterClassA
(
&
wc
),
"Failed to register window class.
\n
"
);
window
=
CreateWindowA
(
"d3d7_test_wndproc_wc"
,
"d3d7_test"
,
WS_MAXIMIZE
|
WS_CAPTION
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
expect_message
=
WM_SETFOCUS
;
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IDirectDraw7_Release
(
ddraw7
);
goto
done
;
}
todo_wine
ok
(
!
expect_message
,
"Expected message %#x, but didn't receive it.
\n
"
,
expect_message
);
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
todo_wine
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
ref
=
IDirectDraw7_Release
(
ddraw7
);
ok
(
ref
==
0
,
"The ddraw object was not properly freed: refcount %u.
\n
"
,
ref
);
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
if
(
FAILED
(
hr
))
{
skip
(
"Failed to create IDirectDraw7 object (%#x), skipping tests.
\n
"
,
hr
);
return
;
}
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
test_proc
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
IDirectDraw7_Release
(
ddraw7
);
goto
done
;
}
proc
=
SetWindowLongPtrA
(
window
,
GWLP_WNDPROC
,
(
LONG_PTR
)
DefWindowProcA
);
todo_wine
ok
(
proc
!=
(
LONG_PTR
)
test_proc
,
"Expected wndproc != %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
test_proc
,
proc
);
ref
=
IDirectDraw7_Release
(
ddraw7
);
ok
(
ref
==
0
,
"The ddraw object was not properly freed: refcount %u.
\n
"
,
ref
);
proc
=
GetWindowLongPtrA
(
window
,
GWLP_WNDPROC
);
ok
(
proc
==
(
LONG_PTR
)
DefWindowProcA
,
"Expected wndproc %#lx, got %#lx.
\n
"
,
(
LONG_PTR
)
DefWindowProcA
,
proc
);
done:
expect_message
=
0
;
DestroyWindow
(
window
);
UnregisterClassA
(
"d3d7_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
}
START_TEST
(
d3d
)
{
init_function_pointers
();
...
...
@@ -3111,4 +3206,6 @@ START_TEST(d3d)
TextureLoadTest
();
D3D1_releaseObjects
();
}
test_wndproc
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment