Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
74ad854e
Commit
74ad854e
authored
Mar 29, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Mar 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm/tests: Use cpp's __LINE__ to print meaningful line numbers.
parent
72be7fe3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
mci.c
dlls/winmm/tests/mci.c
+7
-6
midi.c
dlls/winmm/tests/midi.c
+11
-10
No files found.
dlls/winmm/tests/mci.c
View file @
74ad854e
...
...
@@ -136,7 +136,8 @@ static BOOL spurious_message(LPMSG msg)
}
/* A single ok() in each code path allows to prefix this with todo_wine */
static
void
test_notification
(
HWND
hwnd
,
const
char
*
command
,
WPARAM
type
)
#define test_notification(hwnd, command, type) test_notification_dbg(hwnd, command, type, __LINE__)
static
void
test_notification_dbg
(
HWND
hwnd
,
const
char
*
command
,
WPARAM
type
,
int
line
)
{
/* Use type 0 as meaning no message */
MSG
msg
;
BOOL
seen
;
...
...
@@ -145,17 +146,17 @@ static void test_notification(HWND hwnd, const char* command, WPARAM type)
if
(
type
&&
!
seen
)
{
/* We observe transient delayed notification, mostly on native.
* Notification is not always present right when mciSend returns. */
trace
(
"Waiting for delayed notification from %s
\n
"
,
command
);
trace
_
(
__FILE__
,
line
)
(
"Waiting for delayed notification from %s
\n
"
,
command
);
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
3000
,
QS_POSTMESSAGE
);
seen
=
PeekMessageA
(
&
msg
,
hwnd
,
MM_MCINOTIFY
,
MM_MCINOTIFY
,
PM_REMOVE
);
}
if
(
!
seen
)
ok
(
type
==
0
,
"Expect message %04lx from %s
\n
"
,
type
,
command
);
ok_
(
__FILE__
,
line
)
(
type
==
0
,
"Expect message %04lx from %s
\n
"
,
type
,
command
);
else
if
(
msg
.
hwnd
!=
hwnd
)
ok
(
msg
.
hwnd
==
hwnd
,
"Didn't get the handle to our test window
\n
"
);
ok
_
(
__FILE__
,
line
)
(
msg
.
hwnd
==
hwnd
,
"Didn't get the handle to our test window
\n
"
);
else
if
(
msg
.
message
!=
MM_MCINOTIFY
)
ok
(
msg
.
message
==
MM_MCINOTIFY
,
"got %04x instead of MM_MCINOTIFY from command %s
\n
"
,
msg
.
message
,
command
);
else
ok
(
msg
.
wParam
==
type
,
"got %04lx instead of MCI_NOTIFY_xyz %04lx from command %s
\n
"
,
msg
.
wParam
,
type
,
command
);
ok
_
(
__FILE__
,
line
)
(
msg
.
message
==
MM_MCINOTIFY
,
"got %04x instead of MM_MCINOTIFY from command %s
\n
"
,
msg
.
message
,
command
);
else
ok
_
(
__FILE__
,
line
)
(
msg
.
wParam
==
type
,
"got %04lx instead of MCI_NOTIFY_xyz %04lx from command %s
\n
"
,
msg
.
wParam
,
type
,
command
);
}
static
void
test_openCloseWAVE
(
HWND
hwnd
)
...
...
dlls/winmm/tests/midi.c
View file @
74ad854e
...
...
@@ -61,7 +61,8 @@ static void CALLBACK callback_func(HWAVEOUT hwo, UINT uMsg,
cbinst
=
dwInstance
;
/* MYCBINST, see midiOut/StreamOpen */
}
static
void
test_notification
(
HWND
hwnd
,
const
char
*
command
,
UINT
m1
,
DWORD_PTR
p2
)
#define test_notification(hwnd, command, m1, p2) test_notification_dbg(hwnd, command, m1, p2, __LINE__)
static
void
test_notification_dbg
(
HWND
hwnd
,
const
char
*
command
,
UINT
m1
,
DWORD_PTR
p2
,
int
line
)
{
/* Use message type 0 as meaning no message */
MSG
msg
;
if
(
hwnd
)
{
...
...
@@ -74,29 +75,29 @@ static void test_notification(HWND hwnd, const char* command, UINT m1, DWORD_PTR
* Perhaps the OS preempts the player thread after setting MHDR_DONE
* or clearing MHDR_INQUEUE, before calling DriverCallback. */
DWORD
rc
;
trace
(
"Waiting for delayed message %x from %s
\n
"
,
m1
,
command
);
trace
_
(
__FILE__
,
line
)
(
"Waiting for delayed message %x from %s
\n
"
,
m1
,
command
);
SetLastError
(
0xDEADBEEF
);
rc
=
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
3000
,
QS_POSTMESSAGE
);
ok
(
rc
==
WAIT_OBJECT_0
,
"Wait failed: %04x %d
\n
"
,
rc
,
GetLastError
());
ok
_
(
__FILE__
,
line
)
(
rc
==
WAIT_OBJECT_0
,
"Wait failed: %04x %d
\n
"
,
rc
,
GetLastError
());
seen
=
PeekMessageA
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
);
}
if
(
seen
)
{
trace
(
"Message %x, wParam=%lx, lParam=%lx from %s
\n
"
,
trace
_
(
__FILE__
,
line
)
(
"Message %x, wParam=%lx, lParam=%lx from %s
\n
"
,
msg
.
message
,
msg
.
wParam
,
msg
.
lParam
,
command
);
ok
(
msg
.
hwnd
==
hwnd
,
"Didn't get the handle to our test window
\n
"
);
ok
(
msg
.
message
==
m1
&&
msg
.
lParam
==
p2
,
"bad message %x/%lx from %s, expect %x/%lx
\n
"
,
msg
.
message
,
msg
.
lParam
,
command
,
m1
,
p2
);
ok
_
(
__FILE__
,
line
)
(
msg
.
hwnd
==
hwnd
,
"Didn't get the handle to our test window
\n
"
);
ok
_
(
__FILE__
,
line
)
(
msg
.
message
==
m1
&&
msg
.
lParam
==
p2
,
"bad message %x/%lx from %s, expect %x/%lx
\n
"
,
msg
.
message
,
msg
.
lParam
,
command
,
m1
,
p2
);
}
else
ok
(
m1
==
0
,
"Expect message %x from %s
\n
"
,
m1
,
command
);
else
ok
_
(
__FILE__
,
line
)
(
m1
==
0
,
"Expect message %x from %s
\n
"
,
m1
,
command
);
}
else
{
/* FIXME: MOM_POSITIONCB and MOM_DONE are so close that a queue is needed. */
if
(
cbmsg
)
{
ok
(
cbmsg
==
m1
&&
cbval1
==
p2
&&
cbval2
==
0
,
"bad callback %x/%lx/%lx from %s, expect %x/%lx
\n
"
,
cbmsg
,
cbval1
,
cbval2
,
command
,
m1
,
p2
);
ok
_
(
__FILE__
,
line
)
(
cbmsg
==
m1
&&
cbval1
==
p2
&&
cbval2
==
0
,
"bad callback %x/%lx/%lx from %s, expect %x/%lx
\n
"
,
cbmsg
,
cbval1
,
cbval2
,
command
,
m1
,
p2
);
cbmsg
=
0
;
/* Mark as read */
cbval1
=
cbval2
=
WHATEVER
;
ok
(
cbinst
==
MYCBINST
,
"callback dwInstance changed to %lx
\n
"
,
cbinst
);
ok
_
(
__FILE__
,
line
)
(
cbinst
==
MYCBINST
,
"callback dwInstance changed to %lx
\n
"
,
cbinst
);
}
else
ok
(
m1
==
0
,
"Expect callback %x from %s
\n
"
,
m1
,
command
);
else
ok
_
(
__FILE__
,
line
)
(
m1
==
0
,
"Expect callback %x from %s
\n
"
,
m1
,
command
);
}
}
...
...
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