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
af8760e6
Commit
af8760e6
authored
Sep 09, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msacm32/tests: Add tests for acmFormatSuggest().
parent
d08197f9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
0 deletions
+109
-0
msacm.c
dlls/msacm32/tests/msacm.c
+108
-0
mmreg.h
include/mmreg.h
+1
-0
No files found.
dlls/msacm32/tests/msacm.c
View file @
af8760e6
...
...
@@ -594,8 +594,116 @@ static void test_prepareheader(void)
ok
(
mr
==
MMSYSERR_NOERROR
,
"close failed: 0x%x
\n
"
,
mr
);
}
static
void
test_acmFormatSuggest
(
void
)
{
WAVEFORMATEX
src
,
dst
;
DWORD
suggest
;
MMRESULT
rc
;
/* Test a valid PCM format */
src
.
wFormatTag
=
WAVE_FORMAT_PCM
;
src
.
nChannels
=
1
;
src
.
nSamplesPerSec
=
8000
;
src
.
nAvgBytesPerSec
=
16000
;
src
.
nBlockAlign
=
2
;
src
.
wBitsPerSample
=
16
;
src
.
cbSize
=
0
;
suggest
=
0
;
memset
(
&
dst
,
0
,
sizeof
(
dst
));
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
),
suggest
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"failed with error 0x%x
\n
"
,
rc
);
todo_wine
ok
(
src
.
wFormatTag
==
dst
.
wFormatTag
,
"expected %d, got %d
\n
"
,
src
.
wFormatTag
,
dst
.
wFormatTag
);
ok
(
src
.
nChannels
==
dst
.
nChannels
,
"expected %d, got %d
\n
"
,
src
.
nChannels
,
dst
.
nChannels
);
ok
(
src
.
nSamplesPerSec
==
dst
.
nSamplesPerSec
,
"expected %d, got %d
\n
"
,
src
.
nSamplesPerSec
,
dst
.
nSamplesPerSec
);
todo_wine
ok
(
src
.
nAvgBytesPerSec
==
dst
.
nAvgBytesPerSec
,
"expected %d, got %d
\n
"
,
src
.
nAvgBytesPerSec
,
dst
.
nAvgBytesPerSec
);
todo_wine
ok
(
src
.
nBlockAlign
==
dst
.
nBlockAlign
,
"expected %d, got %d
\n
"
,
src
.
nBlockAlign
,
dst
.
nBlockAlign
);
todo_wine
ok
(
src
.
wBitsPerSample
==
dst
.
wBitsPerSample
,
"expected %d, got %d
\n
"
,
src
.
wBitsPerSample
,
dst
.
wBitsPerSample
);
/* All parameters from destination are valid */
suggest
=
ACM_FORMATSUGGESTF_NCHANNELS
|
ACM_FORMATSUGGESTF_NSAMPLESPERSEC
|
ACM_FORMATSUGGESTF_WBITSPERSAMPLE
|
ACM_FORMATSUGGESTF_WFORMATTAG
;
dst
=
src
;
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
),
suggest
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"failed with error 0x%x
\n
"
,
rc
);
ok
(
src
.
wFormatTag
==
dst
.
wFormatTag
,
"expected %d, got %d
\n
"
,
src
.
wFormatTag
,
dst
.
wFormatTag
);
ok
(
src
.
nChannels
==
dst
.
nChannels
,
"expected %d, got %d
\n
"
,
src
.
nChannels
,
dst
.
nChannels
);
ok
(
src
.
nSamplesPerSec
==
dst
.
nSamplesPerSec
,
"expected %d, got %d
\n
"
,
src
.
nSamplesPerSec
,
dst
.
nSamplesPerSec
);
ok
(
src
.
nAvgBytesPerSec
==
dst
.
nAvgBytesPerSec
,
"expected %d, got %d
\n
"
,
src
.
nAvgBytesPerSec
,
dst
.
nAvgBytesPerSec
);
ok
(
src
.
nBlockAlign
==
dst
.
nBlockAlign
,
"expected %d, got %d
\n
"
,
src
.
nBlockAlign
,
dst
.
nBlockAlign
);
ok
(
src
.
wBitsPerSample
==
dst
.
wBitsPerSample
,
"expected %d, got %d
\n
"
,
src
.
wBitsPerSample
,
dst
.
wBitsPerSample
);
/* Test for WAVE_FORMAT_MSRT24 used in Monster Truck Madness 2 */
src
.
wFormatTag
=
WAVE_FORMAT_MSRT24
;
src
.
nChannels
=
1
;
src
.
nSamplesPerSec
=
8000
;
src
.
nAvgBytesPerSec
=
16000
;
src
.
nBlockAlign
=
2
;
src
.
wBitsPerSample
=
16
;
src
.
cbSize
=
0
;
dst
=
src
;
suggest
=
ACM_FORMATSUGGESTF_NCHANNELS
|
ACM_FORMATSUGGESTF_NSAMPLESPERSEC
|
ACM_FORMATSUGGESTF_WBITSPERSAMPLE
|
ACM_FORMATSUGGESTF_WFORMATTAG
;
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
),
suggest
);
todo_wine
ok
(
rc
==
ACMERR_NOTPOSSIBLE
,
"failed with error 0x%x
\n
"
,
rc
);
memset
(
&
dst
,
0
,
sizeof
(
dst
));
suggest
=
0
;
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
),
suggest
);
todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
/* Invalid struct size */
src
.
wFormatTag
=
WAVE_FORMAT_PCM
;
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
0
,
suggest
);
todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
)
/
2
,
suggest
);
todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
/* cbSize is the last parameter and not required for PCM */
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
)
-
1
,
suggest
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"failed with error 0x%x
\n
"
,
rc
);
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
)
-
sizeof
(
dst
.
cbSize
),
suggest
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"failed with error 0x%x
\n
"
,
rc
);
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
)
-
sizeof
(
dst
.
cbSize
)
-
1
,
suggest
);
todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
/* cbSize is required for others */
src
.
wFormatTag
=
WAVE_FORMAT_ADPCM
;
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
)
-
sizeof
(
dst
.
cbSize
),
suggest
);
todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
)
-
1
,
suggest
);
todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
/* Invalid suggest flags */
src
.
wFormatTag
=
WAVE_FORMAT_PCM
;
suggest
=
0xFFFFFFFF
;
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
&
dst
,
sizeof
(
dst
),
suggest
);
ok
(
rc
==
MMSYSERR_INVALFLAG
,
"failed with error 0x%x
\n
"
,
rc
);
/* Invalid source and destination */
suggest
=
0
;
rc
=
acmFormatSuggest
(
NULL
,
NULL
,
&
dst
,
sizeof
(
dst
),
suggest
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
rc
=
acmFormatSuggest
(
NULL
,
&
src
,
NULL
,
sizeof
(
dst
),
suggest
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
rc
=
acmFormatSuggest
(
NULL
,
NULL
,
NULL
,
sizeof
(
dst
),
suggest
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
}
START_TEST
(
msacm
)
{
driver_tests
();
test_prepareheader
();
test_acmFormatSuggest
();
}
include/mmreg.h
View file @
af8760e6
...
...
@@ -107,6 +107,7 @@ typedef struct _WAVEFORMATEX {
#define WAVE_FORMAT_G721_ADPCM 0x0040
/* Antex Electronics Corporation */
#define WAVE_FORMAT_MPEG 0x0050
/* Microsoft Corporation */
#define WAVE_FORMAT_MPEGLAYER3 0x0055
#define WAVE_FORMAT_MSRT24 0x0082
/* Microsoft Corporation */
#define WAVE_FORMAT_CREATIVE_ADPCM 0x0200
/* Creative Labs, Inc */
#define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202
/* Creative Labs, Inc */
#define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203
/* Creative Labs, Inc */
...
...
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