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
d4861c07
Commit
d4861c07
authored
Jan 10, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime/tests: Move the unrelated COM test out of performance.c.
parent
2343eeff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
51 deletions
+107
-51
Makefile.in
dlls/dmime/tests/Makefile.in
+1
-0
dmime.c
dlls/dmime/tests/dmime.c
+106
-0
performance.c
dlls/dmime/tests/performance.c
+0
-51
No files found.
dlls/dmime/tests/Makefile.in
View file @
d4861c07
...
...
@@ -2,4 +2,5 @@ TESTDLL = dmime.dll
IMPORTS
=
user32 ole32
C_SRCS
=
\
dmime.c
\
performance.c
dlls/dmime/tests/dmime.c
0 → 100644
View file @
d4861c07
/*
* Copyright 2012, 2014 Michael Stefaniuc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdarg.h>
#include <windef.h>
#include <wine/test.h>
#include <dmusici.h>
static
BOOL
missing_dmime
(
void
)
{
IDirectMusicSegment8
*
dms
;
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSegment
,
(
void
**
)
&
dms
);
if
(
hr
==
S_OK
&&
dms
)
{
IDirectMusicSegment_Release
(
dms
);
return
FALSE
;
}
return
TRUE
;
}
static
void
test_COM_segment
(
void
)
{
IDirectMusicSegment8
*
dms
=
(
IDirectMusicSegment8
*
)
0xdeadbeef
;
IDirectMusicObject
*
dmo
;
IPersistStream
*
stream
;
IUnknown
*
unk
;
ULONG
refcount
;
HRESULT
hr
;
/* COM aggregation */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
(
IUnknown
*
)
&
dms
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
dms
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"DirectMusicSegment create failed: %08x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
ok
(
!
dms
,
"dms = %p
\n
"
,
dms
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSound
,
(
void
**
)
&
dms
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicSegment create failed: %08x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSegment8
,
(
void
**
)
&
dms
);
if
(
hr
==
E_NOINTERFACE
)
{
win_skip
(
"DirectMusicSegment without IDirectMusicSegment8
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"DirectMusicSegment create failed: %08x, expected S_OK
\n
"
,
hr
);
refcount
=
IDirectMusicSegment8_AddRef
(
dms
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IDirectMusicSegment8_QueryInterface
(
dms
,
&
IID_IDirectMusicObject
,
(
void
**
)
&
dmo
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IDirectMusicObject failed: %08x
\n
"
,
hr
);
IDirectMusicSegment8_AddRef
(
dms
);
refcount
=
IDirectMusicSegment8_Release
(
dms
);
ok
(
refcount
==
3
,
"refcount == %u, expected 3
\n
"
,
refcount
);
hr
=
IDirectMusicSegment8_QueryInterface
(
dms
,
&
IID_IPersistStream
,
(
void
**
)
&
stream
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersistStream failed: %08x
\n
"
,
hr
);
refcount
=
IDirectMusicSegment8_Release
(
dms
);
ok
(
refcount
==
3
,
"refcount == %u, expected 3
\n
"
,
refcount
);
hr
=
IDirectMusicSegment8_QueryInterface
(
dms
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_Release
(
unk
);
ok
(
refcount
==
3
,
"refcount == %u, expected 3
\n
"
,
refcount
);
refcount
=
IDirectMusicObject_Release
(
dmo
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
refcount
=
IPersistStream_Release
(
stream
);
ok
(
refcount
==
1
,
"refcount == %u, expected 1
\n
"
,
refcount
);
refcount
=
IDirectMusicSegment8_Release
(
dms
);
ok
(
refcount
==
0
,
"refcount == %u, expected 0
\n
"
,
refcount
);
}
START_TEST
(
dmime
)
{
CoInitialize
(
NULL
);
if
(
missing_dmime
())
{
skip
(
"dmime not available
\n
"
);
CoUninitialize
();
return
;
}
test_COM_segment
();
CoUninitialize
();
}
dlls/dmime/tests/performance.c
View file @
d4861c07
...
...
@@ -255,55 +255,6 @@ static void test_COM(void)
ok
(
refcount
==
0
,
"refcount == %u, expected 0
\n
"
,
refcount
);
}
static
void
test_dms_COM
(
void
)
{
IDirectMusicSegment8
*
dms
=
(
IDirectMusicSegment8
*
)
0xdeadbeef
;
IDirectMusicObject
*
dmo
;
IPersistStream
*
stream
;
IUnknown
*
unk
;
ULONG
refcount
;
HRESULT
hr
;
/* COM aggregation */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
(
IUnknown
*
)
&
dms
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
dms
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"DirectMusicSegment create failed: %08x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
ok
(
!
dms
,
"dms = %p
\n
"
,
dms
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectSound
,
(
void
**
)
&
dms
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicSegment create failed: %08x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicSegment
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicSegment8
,
(
void
**
)
&
dms
);
ok
(
hr
==
S_OK
,
"DirectMusicSegment create failed: %08x, expected S_OK
\n
"
,
hr
);
refcount
=
IDirectMusicSegment8_AddRef
(
dms
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IDirectMusicSegment8_QueryInterface
(
dms
,
&
IID_IDirectMusicObject
,
(
void
**
)
&
dmo
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IDirectMusicObject failed: %08x
\n
"
,
hr
);
IDirectMusicSegment8_AddRef
(
dms
);
refcount
=
IDirectMusicSegment8_Release
(
dms
);
ok
(
refcount
==
3
,
"refcount == %u, expected 3
\n
"
,
refcount
);
hr
=
IDirectMusicSegment8_QueryInterface
(
dms
,
&
IID_IPersistStream
,
(
void
**
)
&
stream
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersistStream failed: %08x
\n
"
,
hr
);
refcount
=
IDirectMusicSegment8_Release
(
dms
);
ok
(
refcount
==
3
,
"refcount == %u, expected 3
\n
"
,
refcount
);
hr
=
IDirectMusicSegment8_QueryInterface
(
dms
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_Release
(
unk
);
ok
(
refcount
==
3
,
"refcount == %u, expected 3
\n
"
,
refcount
);
refcount
=
IDirectMusicObject_Release
(
dmo
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
refcount
=
IPersistStream_Release
(
stream
);
ok
(
refcount
==
1
,
"refcount == %u, expected 1
\n
"
,
refcount
);
refcount
=
IDirectMusicSegment8_Release
(
dms
);
ok
(
refcount
==
0
,
"refcount == %u, expected 0
\n
"
,
refcount
);
}
START_TEST
(
performance
)
{
HRESULT
hr
;
...
...
@@ -323,7 +274,5 @@ START_TEST( performance )
test_COM
();
test_createport
();
test_dms_COM
();
CoUninitialize
();
}
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