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
0030ef8d
Commit
0030ef8d
authored
Mar 24, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Sep 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm/tests: MCI_STATUS returns DWORD_PTR, unlike other commands.
parent
0cf326ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
mci.c
dlls/winmm/tests/mci.c
+78
-0
No files found.
dlls/winmm/tests/mci.c
View file @
0030ef8d
...
...
@@ -162,6 +162,83 @@ static void test_notification_dbg(HWND hwnd, const char* command, WPARAM type, i
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_mciParser
(
HWND
hwnd
)
{
MCIERROR
err
;
MCIDEVICEID
wDeviceID
;
MCI_PARMS_UNION
parm
;
char
buf
[
1024
];
memset
(
buf
,
0
,
sizeof
(
buf
));
test_notification
(
hwnd
,
"-prior to parser test-"
,
0
);
/* Get a handle on an MCI device, works even without sound. */
parm
.
open
.
lpstrDeviceType
=
"waveaudio"
;
parm
.
open
.
lpstrElementName
=
""
;
/* "new" at the command level */
parm
.
open
.
lpstrAlias
=
"x"
;
/* to enable mciSendString */
parm
.
open
.
dwCallback
=
(
DWORD_PTR
)
hwnd
;
err
=
mciSendCommand
(
0
,
MCI_OPEN
,
MCI_OPEN_ELEMENT
|
MCI_OPEN_TYPE
|
MCI_OPEN_ALIAS
|
MCI_NOTIFY
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand open new type waveaudio alias x notify: %s
\n
"
,
dbg_mcierr
(
err
));
wDeviceID
=
parm
.
open
.
wDeviceID
;
ok
(
!
strcmp
(
parm
.
open
.
lpstrDeviceType
,
"waveaudio"
),
"open modified device type
\n
"
);
test_notification
(
hwnd
,
"MCI_OPEN"
,
MCI_NOTIFY_SUCCESSFUL
);
test_notification
(
hwnd
,
"MCI_OPEN no #2"
,
0
);
/* MCI_STATUS' dwReturn is a DWORD_PTR, others' a plain DWORD. */
parm
.
status
.
dwItem
=
MCI_STATUS_TIME_FORMAT
;
parm
.
status
.
dwReturn
=
0xFEEDABAD
;
err
=
mciSendCommand
(
wDeviceID
,
MCI_STATUS
,
MCI_STATUS_ITEM
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand status time format: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
MCI_FORMAT_MILLISECONDS
==
parm
.
status
.
dwReturn
,
"status time format: %ld
\n
"
,
parm
.
status
.
dwReturn
);
parm
.
status
.
dwItem
=
MCI_STATUS_MODE
;
parm
.
status
.
dwReturn
=
0xFEEDABAD
;
err
=
mciSendCommand
(
wDeviceID
,
MCI_STATUS
,
MCI_STATUS_ITEM
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand status mode: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
MCI_MODE_STOP
==
parm
.
status
.
dwReturn
,
"STATUS mode: %ld
\n
"
,
parm
.
status
.
dwReturn
);
err
=
mciSendString
(
"status x mode"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"status mode: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"stopped"
),
"status mode is %s
\n
"
,
buf
);
parm
.
caps
.
dwItem
=
MCI_GETDEVCAPS_USES_FILES
;
parm
.
caps
.
dwReturn
=
0xFEEDABAD
;
err
=
mciSendCommand
(
wDeviceID
,
MCI_GETDEVCAPS
,
MCI_GETDEVCAPS_ITEM
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand getdevcaps files: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
1
==
parm
.
caps
.
dwReturn
,
"getdevcaps files: %d
\n
"
,
parm
.
caps
.
dwReturn
);
parm
.
caps
.
dwItem
=
MCI_GETDEVCAPS_HAS_VIDEO
;
parm
.
caps
.
dwReturn
=
0xFEEDABAD
;
err
=
mciSendCommand
(
wDeviceID
,
MCI_GETDEVCAPS
,
MCI_GETDEVCAPS_ITEM
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand getdevcaps video: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
0
==
parm
.
caps
.
dwReturn
,
"getdevcaps video: %d
\n
"
,
parm
.
caps
.
dwReturn
);
parm
.
caps
.
dwItem
=
MCI_GETDEVCAPS_DEVICE_TYPE
;
parm
.
caps
.
dwReturn
=
0xFEEDABAD
;
err
=
mciSendCommand
(
wDeviceID
,
MCI_GETDEVCAPS
,
MCI_GETDEVCAPS_ITEM
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand getdevcaps video: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
MCI_DEVTYPE_WAVEFORM_AUDIO
==
parm
.
caps
.
dwReturn
,
"getdevcaps device type: %d
\n
"
,
parm
.
caps
.
dwReturn
);
err
=
mciSendString
(
"capability x uses files"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"capability files: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"true"
),
"capability files is %s
\n
"
,
buf
);
err
=
mciSendString
(
"capability x has video"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"capability video: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"false"
),
"capability video is %s
\n
"
,
buf
);
err
=
mciSendString
(
"capability x device type"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"capability device type: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"waveaudio"
),
"capability device type is %s
\n
"
,
buf
);
err
=
mciSendCommand
(
wDeviceID
,
MCI_CLOSE
,
0
,
0
);
ok
(
!
err
,
"mciCommand close returned %s
\n
"
,
dbg_mcierr
(
err
));
test_notification
(
hwnd
,
"-end of 1st set-"
,
0
);
}
static
void
test_openCloseWAVE
(
HWND
hwnd
)
{
MCIERROR
err
;
...
...
@@ -1012,6 +1089,7 @@ START_TEST(mci)
HWND
hwnd
;
hwnd
=
CreateWindowExA
(
0
,
"static"
,
"winmm test"
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
test_mciParser
(
hwnd
);
test_openCloseWAVE
(
hwnd
);
test_recordWAVE
(
hwnd
);
test_playWAVE
(
hwnd
);
...
...
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