Module: wine Branch: master Commit: 425608a1205ed93bd00fc3ed920e57f6657deaff URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=425608a1205ed93bd00fc3ed...
Author: Robert Reif reif@earthlink.net Date: Fri Aug 18 01:14:12 2006 -0400
dsound: Add class factory tests.
---
dlls/dsound/tests/capture.c | 11 +++++++++++ dlls/dsound/tests/dsound.c | 11 +++++++++++ dlls/dsound/tests/dsound8.c | 11 +++++++++++ dlls/dsound/tests/duplex.c | 4 ++-- dlls/dsound/tests/propset.c | 9 +++++++++ 5 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index 5185e4e..8ed8aa2 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -192,9 +192,20 @@ static void IDirectSoundCapture_tests(vo { 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); diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 5d4845c..6163484 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -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); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index e207a9e..af90ac6 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -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); diff --git a/dlls/dsound/tests/duplex.c b/dlls/dsound/tests/duplex.c index 2b23833..e4095c1 100644 --- a/dlls/dsound/tests/duplex.c +++ b/dlls/dsound/tests/duplex.c @@ -66,7 +66,7 @@ static void IDirectSoundFullDuplex_test( 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 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, diff --git a/dlls/dsound/tests/propset.c b/dlls/dsound/tests/propset.c index 766b338..2c11afa 100644 --- a/dlls/dsound/tests/propset.c +++ b/dlls/dsound/tests/propset.c @@ -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));