Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
632d9361
Commit
632d9361
authored
11 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dmscript/tests: Add COM tests for DirectMusicScript.
parent
d3ba2a9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-0
1 addition, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
dlls/dmscript/tests/Makefile.in
+5
-0
5 additions, 0 deletions
dlls/dmscript/tests/Makefile.in
dlls/dmscript/tests/dmscript.c
+148
-0
148 additions, 0 deletions
dlls/dmscript/tests/dmscript.c
with
155 additions
and
0 deletions
configure
+
1
−
0
View file @
632d9361
...
...
@@ -16734,6 +16734,7 @@ wine_fn_config_test dlls/dmime/tests dmime_test
wine_fn_config_dll dmloader enable_dmloader clean
wine_fn_config_test dlls/dmloader/tests dmloader_test
wine_fn_config_dll dmscript enable_dmscript clean
wine_fn_config_test dlls/dmscript/tests dmscript_test
wine_fn_config_dll dmstyle enable_dmstyle clean
wine_fn_config_dll dmsynth enable_dmsynth clean
wine_fn_config_test dlls/dmsynth/tests dmsynth_test
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
View file @
632d9361
...
...
@@ -2787,6 +2787,7 @@ WINE_CONFIG_TEST(dlls/dmime/tests)
WINE_CONFIG_DLL(dmloader,,[clean])
WINE_CONFIG_TEST(dlls/dmloader/tests)
WINE_CONFIG_DLL(dmscript,,[clean])
WINE_CONFIG_TEST(dlls/dmscript/tests)
WINE_CONFIG_DLL(dmstyle,,[clean])
WINE_CONFIG_DLL(dmsynth,,[clean])
WINE_CONFIG_TEST(dlls/dmsynth/tests)
...
...
This diff is collapsed.
Click to expand it.
dlls/dmscript/tests/Makefile.in
0 → 100644
+
5
−
0
View file @
632d9361
TESTDLL
=
dmscript.dll
IMPORTS
=
ole32
C_SRCS
=
\
dmscript.c
This diff is collapsed.
Click to expand it.
dlls/dmscript/tests/dmscript.c
0 → 100644
+
148
−
0
View file @
632d9361
/*
* Copyright 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
<initguid.h>
#include
<wine/test.h>
#include
<dmusici.h>
static
BOOL
missing_dmscript
(
void
)
{
IDirectMusicScript
*
dms
;
HRESULT
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicScript
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicScript
,
(
void
**
)
&
dms
);
if
(
hr
==
S_OK
&&
dms
)
{
IDirectMusicScript_Release
(
dms
);
return
FALSE
;
}
return
TRUE
;
}
/* Outer IUnknown for COM aggregation tests */
struct
unk_impl
{
IUnknown
IUnknown_iface
;
LONG
ref
;
IUnknown
*
inner_unk
;
};
static
inline
struct
unk_impl
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
unk_impl
,
IUnknown_iface
);
}
static
HRESULT
WINAPI
unk_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
unk_impl
*
This
=
impl_from_IUnknown
(
iface
);
return
IUnknown_QueryInterface
(
This
->
inner_unk
,
riid
,
ppv
);
}
static
ULONG
WINAPI
unk_AddRef
(
IUnknown
*
iface
)
{
struct
unk_impl
*
This
=
impl_from_IUnknown
(
iface
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
unk_Release
(
IUnknown
*
iface
)
{
struct
unk_impl
*
This
=
impl_from_IUnknown
(
iface
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
static
const
IUnknownVtbl
unk_vtbl
=
{
unk_QueryInterface
,
unk_AddRef
,
unk_Release
};
static
void
test_COM
(
void
)
{
IDirectMusicScript
*
dms
=
NULL
;
IDirectMusicObject
*
dmo
;
IPersistStream
*
ps
;
IUnknown
*
unk
;
struct
unk_impl
unk_obj
=
{{
&
unk_vtbl
},
19
,
NULL
};
ULONG
refcount
;
HRESULT
hr
;
/* COM aggregation */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicScript
,
(
IUnknown
*
)
&
dms
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
dms
);
todo_wine
ok
(
hr
==
E_POINTER
,
"DirectMusicScript create failed: %08x, expected E_POINTER
\n
"
,
hr
);
/* An invalid non-NULL pUnkOuter crashes newer Windows versions */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicScript
,
&
unk_obj
.
IUnknown_iface
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
unk_obj
.
inner_unk
);
ok
(
hr
==
CLASS_E_NOAGGREGATION
,
"DirectMusicScript create failed: %08x, expected CLASS_E_NOAGGREGATION
\n
"
,
hr
);
ok
(
!
unk_obj
.
inner_unk
,
"unk_obj.inner_unk = %p
\n
"
,
unk_obj
.
inner_unk
);
/* Invalid RIID */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicScript
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IClassFactory
,
(
void
**
)
&
dms
);
ok
(
hr
==
E_NOINTERFACE
,
"DirectMusicScript create failed: %08x, expected E_NOINTERFACE
\n
"
,
hr
);
/* Same refcount for all DirectMusicScript interfaces */
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicScript
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectMusicScript
,
(
void
**
)
&
dms
);
ok
(
hr
==
S_OK
,
"DirectMusicScript create failed: %08x, expected S_OK
\n
"
,
hr
);
refcount
=
IDirectMusicScript_AddRef
(
dms
);
ok
(
refcount
==
2
,
"refcount == %u, expected 2
\n
"
,
refcount
);
hr
=
IDirectMusicScript_QueryInterface
(
dms
,
&
IID_IDirectMusicObject
,
(
void
**
)
&
dmo
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IDirectMusicObject failed: %08x
\n
"
,
hr
);
refcount
=
IDirectMusicObject_AddRef
(
dmo
);
ok
(
refcount
==
4
,
"refcount == %u, expected 4
\n
"
,
refcount
);
refcount
=
IDirectMusicObject_Release
(
dmo
);
hr
=
IDirectMusicScript_QueryInterface
(
dms
,
&
IID_IPersistStream
,
(
void
**
)
&
ps
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IPersistStream failed: %08x
\n
"
,
hr
);
refcount
=
IPersistStream_AddRef
(
ps
);
ok
(
refcount
==
5
,
"refcount == %u, expected 5
\n
"
,
refcount
);
refcount
=
IPersistStream_Release
(
ps
);
hr
=
IDirectMusicScript_QueryInterface
(
dms
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"QueryInterface for IID_IUnknown failed: %08x
\n
"
,
hr
);
refcount
=
IUnknown_AddRef
(
unk
);
ok
(
refcount
==
6
,
"refcount == %u, expected 6
\n
"
,
refcount
);
refcount
=
IUnknown_Release
(
unk
);
while
(
IDirectMusicScript_Release
(
dms
));
}
START_TEST
(
dmscript
)
{
CoInitialize
(
NULL
);
if
(
missing_dmscript
())
{
skip
(
"dmscript not available
\n
"
);
CoUninitialize
();
return
;
}
test_COM
();
CoUninitialize
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment