Commit 425608a1 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

dsound: Add class factory tests.

parent 595d6aa6
......@@ -192,9 +192,20 @@ static void IDirectSoundCapture_tests(void)
{
HRESULT rc;
LPDIRECTSOUNDCAPTURE dsco=NULL;
LPCLASSFACTORY cf=NULL;
trace("Testing IDirectSoundCapture\n");
rc=CoGetClassObject(&CLSID_DirectSoundCapture, CLSCTX_INPROC_SERVER, NULL,
&IID_IClassFactory, (void**)&cf);
ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSoundCapture, IID_IClassFactory) "
"failed: %s\n", DXGetErrorString8(rc));
rc=CoGetClassObject(&CLSID_DirectSoundCapture, CLSCTX_INPROC_SERVER, NULL,
&IID_IUnknown, (void**)&cf);
ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSoundCapture, IID_IUnknown) "
"failed: %s\n", DXGetErrorString8(rc));
/* try the COM class factory method of creation with no device specified */
rc=CoCreateInstance(&CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectSoundCapture, (void**)&dsco);
......
......@@ -172,9 +172,20 @@ static void IDirectSound_tests(void)
{
HRESULT rc;
LPDIRECTSOUND dso=NULL;
LPCLASSFACTORY cf=NULL;
trace("Testing IDirectSound\n");
rc=CoGetClassObject(&CLSID_DirectSound, CLSCTX_INPROC_SERVER, NULL,
&IID_IClassFactory, (void**)&cf);
ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound, IID_IClassFactory) "
"failed: %s\n", DXGetErrorString8(rc));
rc=CoGetClassObject(&CLSID_DirectSound, CLSCTX_INPROC_SERVER, NULL,
&IID_IUnknown, (void**)&cf);
ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound, IID_IUnknown) "
"failed: %s\n", DXGetErrorString8(rc));
/* try the COM class factory method of creation with no device specified */
rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectSound, (void**)&dso);
......
......@@ -191,9 +191,20 @@ static void IDirectSound8_tests(void)
{
HRESULT rc;
LPDIRECTSOUND8 dso=NULL;
LPCLASSFACTORY cf=NULL;
trace("Testing IDirectSound8\n");
rc=CoGetClassObject(&CLSID_DirectSound8, CLSCTX_INPROC_SERVER, NULL,
&IID_IClassFactory, (void**)&cf);
ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound8, IID_IClassFactory) "
"failed: %s\n", DXGetErrorString8(rc));
rc=CoGetClassObject(&CLSID_DirectSound8, CLSCTX_INPROC_SERVER, NULL,
&IID_IUnknown, (void**)&cf);
ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound8, IID_IUnknown) "
"failed: %s\n", DXGetErrorString8(rc));
/* try the COM class factory method of creation with no device specified */
rc=CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER,
&IID_IDirectSound8, (void**)&dso);
......
......@@ -66,7 +66,7 @@ static void IDirectSoundFullDuplex_test(LPDIRECTSOUNDFULLDUPLEX dsfdo,
ok(ref==0, "IDirectSound_Release() has %d references, "
"should have 0\n", ref);
}
rc=IDirectSoundFullDuplex_QueryInterface(dsfdo,&IID_IDirectSound8,(LPVOID*)&ds8);
ok(rc==(initialized?DS_OK:E_NOINTERFACE),"IDirectSoundFullDuplex_QueryInterface(IID_IDirectSound8) "
"failed: %s\n",DXGetErrorString8(rc));
......@@ -136,7 +136,7 @@ static void IDirectSoundFullDuplex_tests(void)
if (dsfdo)
IDirectSoundFullDuplex_test(dsfdo, FALSE, NULL, NULL);
/* try the COM class factory method of creation with default devices
/* try the COM class factory method of creation with default devices
* specified */
rc=CoCreateInstance(&CLSID_DirectSoundFullDuplex, NULL,
CLSCTX_INPROC_SERVER, &IID_IDirectSoundFullDuplex,
......
......@@ -202,6 +202,15 @@ static void propset_private_tests(void)
"IID_IClassFactory) should have returned DSERR_INVALIDPARAM, "
"returned: %s\n",DXGetErrorString8(rc));
rc = (fProc)(&CLSID_DirectSound, &IID_IDirectSound, (void **)(&pcf));
ok(rc==E_NOINTERFACE,"DllGetClassObject(CLSID_DirectSound, "
"IID_IDirectSound) should have returned E_NOINTERFACE, "
"returned: %s\n",DXGetErrorString8(rc));
rc = (fProc)(&CLSID_DirectSound, &IID_IUnknown, (void **)(&pcf));
ok(rc==DS_OK,"DllGetClassObject(CLSID_DirectSound, "
"IID_IUnknown) failed: %s\n",DXGetErrorString8(rc));
rc = (fProc)(&CLSID_DirectSound, &IID_IClassFactory, (void **)(&pcf));
ok(pcf!=0, "DllGetClassObject(CLSID_DirectSound, IID_IClassFactory) "
"failed: %s\n",DXGetErrorString8(rc));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment