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
ae725df5
Commit
ae725df5
authored
Jan 15, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Add a small tests for SetCooperativeLevel() calls with different windows.
In particular, test that the windows aren't destroyed by accident.
parent
b43f8976
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
0 deletions
+124
-0
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+31
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+31
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+31
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+31
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
ae725df5
...
...
@@ -2629,6 +2629,36 @@ static void test_coop_level_surf_create(void)
IDirectDraw_Release
(
ddraw
);
}
static
void
test_coop_level_multi_window
(
void
)
{
HWND
window1
,
window2
;
IDirectDraw
*
ddraw
;
HRESULT
hr
;
window1
=
CreateWindowA
(
"static"
,
"ddraw_test1"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
window2
=
CreateWindowA
(
"static"
,
"ddraw_test2"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
return
;
}
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window1
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw_SetCooperativeLevel
(
ddraw
,
window2
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsWindow
(
window1
),
"Window 1 was destroyed.
\n
"
);
ok
(
IsWindow
(
window2
),
"Window 2 was destroyed.
\n
"
);
IDirectDraw_Release
(
ddraw
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
}
START_TEST
(
ddraw1
)
{
test_coop_level_create_device_window
();
...
...
@@ -2649,4 +2679,5 @@ START_TEST(ddraw1)
test_coop_level_mode_set_multi
();
test_initialize
();
test_coop_level_surf_create
();
test_coop_level_multi_window
();
}
dlls/ddraw/tests/ddraw2.c
View file @
ae725df5
...
...
@@ -2748,6 +2748,36 @@ static void test_coop_level_surf_create(void)
IDirectDraw2_Release
(
ddraw
);
}
static
void
test_coop_level_multi_window
(
void
)
{
HWND
window1
,
window2
;
IDirectDraw2
*
ddraw
;
HRESULT
hr
;
window1
=
CreateWindowA
(
"static"
,
"ddraw_test1"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
window2
=
CreateWindowA
(
"static"
,
"ddraw_test2"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
return
;
}
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window1
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw2_SetCooperativeLevel
(
ddraw
,
window2
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsWindow
(
window1
),
"Window 1 was destroyed.
\n
"
);
ok
(
IsWindow
(
window2
),
"Window 2 was destroyed.
\n
"
);
IDirectDraw2_Release
(
ddraw
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
}
START_TEST
(
ddraw2
)
{
test_coop_level_create_device_window
();
...
...
@@ -2770,4 +2800,5 @@ START_TEST(ddraw2)
test_coop_level_mode_set_multi
();
test_initialize
();
test_coop_level_surf_create
();
test_coop_level_multi_window
();
}
dlls/ddraw/tests/ddraw4.c
View file @
ae725df5
...
...
@@ -2935,6 +2935,36 @@ static void test_vb_discard(void)
DestroyWindow
(
window
);
}
static
void
test_coop_level_multi_window
(
void
)
{
HWND
window1
,
window2
;
IDirectDraw4
*
ddraw
;
HRESULT
hr
;
window1
=
CreateWindowA
(
"static"
,
"ddraw_test1"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
window2
=
CreateWindowA
(
"static"
,
"ddraw_test2"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
return
;
}
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window1
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_SetCooperativeLevel
(
ddraw
,
window2
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsWindow
(
window1
),
"Window 1 was destroyed.
\n
"
);
ok
(
IsWindow
(
window2
),
"Window 2 was destroyed.
\n
"
);
IDirectDraw4_Release
(
ddraw
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
}
START_TEST
(
ddraw4
)
{
test_process_vertices
();
...
...
@@ -2959,4 +2989,5 @@ START_TEST(ddraw4)
test_initialize
();
test_coop_level_surf_create
();
test_vb_discard
();
test_coop_level_multi_window
();
}
dlls/ddraw/tests/ddraw7.c
View file @
ae725df5
...
...
@@ -2744,6 +2744,36 @@ static void test_vb_discard(void)
DestroyWindow
(
window
);
}
static
void
test_coop_level_multi_window
(
void
)
{
HWND
window1
,
window2
;
IDirectDraw7
*
ddraw
;
HRESULT
hr
;
window1
=
CreateWindowA
(
"static"
,
"ddraw_test1"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
window2
=
CreateWindowA
(
"static"
,
"ddraw_test2"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
ddraw
=
create_ddraw
()))
{
skip
(
"Failed to create a ddraw object, skipping test.
\n
"
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
return
;
}
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window1
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw
,
window2
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set cooperative level, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsWindow
(
window1
),
"Window 1 was destroyed.
\n
"
);
ok
(
IsWindow
(
window2
),
"Window 2 was destroyed.
\n
"
);
IDirectDraw7_Release
(
ddraw
);
DestroyWindow
(
window2
);
DestroyWindow
(
window1
);
}
START_TEST
(
ddraw7
)
{
HMODULE
module
=
GetModuleHandleA
(
"ddraw.dll"
);
...
...
@@ -2775,4 +2805,5 @@ START_TEST(ddraw7)
test_initialize
();
test_coop_level_surf_create
();
test_vb_discard
();
test_coop_level_multi_window
();
}
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