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
ae600c0b
Commit
ae600c0b
authored
Apr 27, 2017
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmloader/tests: Add some IDirectMusicLoader directory tests.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a69dbd41
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
loader.c
dlls/dmloader/tests/loader.c
+41
-0
No files found.
dlls/dmloader/tests/loader.c
View file @
ae600c0b
...
...
@@ -22,6 +22,8 @@
#include "dmusici.h"
#include "wine/test.h"
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
static
unsigned
char
mp3file
[]
=
"
\xFF\xFB\x92\x04
"
;
/* MP3 header */
static
unsigned
char
rifffile
[
8
+
4
+
8
+
16
+
8
+
256
]
=
"RIFF
\x24\x01\x00\x00
WAVE"
/* header: 4 ("WAVE") + (8 + 16) (format segment) + (8 + 256) (data segment) = 0x124 */
"fmt
\x10\x00\x00\x00\x01\x00\x20\x00\xAC\x44\x00\x00\x10\xB1\x02\x00\x04\x00\x10\x00
"
/* format segment: PCM, 2 chan, 44100 Hz, 16 bits */
...
...
@@ -41,6 +43,44 @@ static BOOL missing_dmloader(void)
return
TRUE
;
}
static
void
test_directory
(
void
)
{
IDirectMusicLoader8
*
loader
=
NULL
;
HRESULT
hr
;
WCHAR
con
[]
=
{
'c'
,
'o'
,
'n'
};
WCHAR
path
[
MAX_PATH
];
WCHAR
invalid_path
[]
=
{
'/'
,
'i'
,
'n'
,
'v'
,
'a'
,
'l'
,
'i'
,
'd'
,
' '
,
'p'
,
'a'
,
't'
,
'h'
,
0
};
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicLoader
,
NULL
,
CLSCTX_INPROC
,
&
IID_IDirectMusicLoader8
,
(
void
**
)
&
loader
);
ok
(
hr
==
S_OK
,
"Couldn't create Loader %#x
\n
"
,
hr
);
/* ScanDirectory without a previous SetSearchDirectory isn't failing */
hr
=
IDirectMusicLoader_ScanDirectory
(
loader
,
&
CLSID_DirectMusicContainer
,
con
,
NULL
);
ok
(
hr
==
S_FALSE
,
"ScanDirectory for
\"
con
\"
files failed with %#x
\n
"
,
hr
);
/* SetSearchDirectory with invalid path */
hr
=
IDirectMusicLoader_SetSearchDirectory
(
loader
,
&
GUID_DirectMusicAllTypes
,
invalid_path
,
0
);
ok
(
hr
==
DMUS_E_LOADER_BADPATH
,
"SetSearchDirectory failed with %#x
\n
"
,
hr
);
/* Two consecutive SetSearchDirectory with the same path */
GetTempPathW
(
ARRAY_SIZE
(
path
),
path
);
hr
=
IDirectMusicLoader_SetSearchDirectory
(
loader
,
&
GUID_DirectMusicAllTypes
,
path
,
0
);
todo_wine
ok
(
hr
==
S_OK
,
"SetSearchDirectory failed with %#x
\n
"
,
hr
);
hr
=
IDirectMusicLoader_SetSearchDirectory
(
loader
,
&
GUID_DirectMusicAllTypes
,
path
,
0
);
ok
(
hr
==
S_FALSE
,
"Second SetSearchDirectory failed with %#x
\n
"
,
hr
);
hr
=
IDirectMusicLoader_SetSearchDirectory
(
loader
,
&
CLSID_DirectSoundWave
,
path
,
0
);
ok
(
hr
==
S_OK
,
"SetSearchDirectory failed with %#x
\n
"
,
hr
);
hr
=
IDirectMusicLoader_SetSearchDirectory
(
loader
,
&
CLSID_DirectSoundWave
,
path
,
0
);
ok
(
hr
==
S_FALSE
,
"Second SetSearchDirectory failed with %#x
\n
"
,
hr
);
/* NULL extension is not an error */
hr
=
IDirectMusicLoader_ScanDirectory
(
loader
,
&
CLSID_DirectSoundWave
,
NULL
,
NULL
);
ok
(
hr
==
S_FALSE
,
"ScanDirectory for
\"
wav
\"
files failed, received %#x
\n
"
,
hr
);
IDirectMusicLoader_Release
(
loader
);
}
static
void
test_release_object
(
void
)
{
HRESULT
hr
;
...
...
@@ -295,6 +335,7 @@ START_TEST(loader)
CoUninitialize
();
return
;
}
test_directory
();
test_release_object
();
test_simple_playing
();
test_COM
();
...
...
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