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
8a9115d9
Commit
8a9115d9
authored
Nov 10, 2014
by
Qian Hong
Committed by
Alexandre Julliard
Nov 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test exception handling for timer callbacks.
parent
cd21d2db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
msg.c
dlls/user32/tests/msg.c
+43
-0
No files found.
dlls/user32/tests/msg.c
View file @
8a9115d9
...
@@ -8448,6 +8448,13 @@ static void CALLBACK callback_count(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWOR
...
@@ -8448,6 +8448,13 @@ static void CALLBACK callback_count(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWOR
count
++
;
count
++
;
}
}
static
DWORD
exception
;
static
void
CALLBACK
callback_exception
(
HWND
hwnd
,
UINT
uMsg
,
UINT_PTR
idEvent
,
DWORD
dwTime
)
{
count
++
;
RaiseException
(
exception
,
0
,
0
,
NULL
);
}
static
DWORD
WINAPI
timer_thread_proc
(
LPVOID
x
)
static
DWORD
WINAPI
timer_thread_proc
(
LPVOID
x
)
{
{
struct
timer_info
*
info
=
x
;
struct
timer_info
*
info
=
x
;
...
@@ -8578,6 +8585,41 @@ static void test_timers_no_wnd(void)
...
@@ -8578,6 +8585,41 @@ static void test_timers_no_wnd(void)
/* Note: SetSystemTimer doesn't support a NULL window, see test_timers */
/* Note: SetSystemTimer doesn't support a NULL window, see test_timers */
}
}
static
void
test_timers_exception
(
DWORD
code
)
{
UINT_PTR
id
;
MSG
msg
;
exception
=
code
;
id
=
SetTimer
(
NULL
,
0
,
1000
,
callback_exception
);
ok
(
id
!=
0
,
"did not get id from SetTimer.
\n
"
);
memset
(
&
msg
,
0
,
sizeof
(
msg
));
msg
.
message
=
WM_TIMER
;
msg
.
wParam
=
id
;
msg
.
lParam
=
(
LPARAM
)
callback_exception
;
count
=
0
;
DispatchMessageA
(
&
msg
);
ok
(
count
==
1
,
"did not get one count as expected (%i).
\n
"
,
count
);
KillTimer
(
NULL
,
id
);
}
static
void
test_timers_exceptions
(
void
)
{
test_timers_exception
(
EXCEPTION_ACCESS_VIOLATION
);
test_timers_exception
(
EXCEPTION_DATATYPE_MISALIGNMENT
);
test_timers_exception
(
EXCEPTION_BREAKPOINT
);
test_timers_exception
(
EXCEPTION_SINGLE_STEP
);
test_timers_exception
(
EXCEPTION_ARRAY_BOUNDS_EXCEEDED
);
test_timers_exception
(
EXCEPTION_FLT_DENORMAL_OPERAND
);
test_timers_exception
(
EXCEPTION_FLT_DIVIDE_BY_ZERO
);
test_timers_exception
(
EXCEPTION_FLT_INEXACT_RESULT
);
test_timers_exception
(
EXCEPTION_ILLEGAL_INSTRUCTION
);
test_timers_exception
(
0xE000BEEF
);
/* customer exception */
}
/* Various win events with arbitrary parameters */
/* Various win events with arbitrary parameters */
static
const
struct
message
WmWinEventsSeq
[]
=
{
static
const
struct
message
WmWinEventsSeq
[]
=
{
{
EVENT_SYSTEM_SOUND
,
winevent_hook
|
wparam
|
lparam
,
OBJID_WINDOW
,
0
},
{
EVENT_SYSTEM_SOUND
,
winevent_hook
|
wparam
|
lparam
,
OBJID_WINDOW
,
0
},
...
@@ -14619,6 +14661,7 @@ START_TEST(msg)
...
@@ -14619,6 +14661,7 @@ START_TEST(msg)
test_accelerators
();
test_accelerators
();
test_timers
();
test_timers
();
test_timers_no_wnd
();
test_timers_no_wnd
();
test_timers_exceptions
();
if
(
hCBT_hook
)
test_set_hook
();
if
(
hCBT_hook
)
test_set_hook
();
test_DestroyWindow
();
test_DestroyWindow
();
test_DispatchMessage
();
test_DispatchMessage
();
...
...
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