[DSOUND] print info about primary buffer in tests

Robert Reif reif at earthlink.net
Thu Feb 10 12:58:01 CST 2005


Print info about primary buffer format.
-------------- next part --------------
Index: dlls/dsound/tests/ds3d.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/ds3d.c,v
retrieving revision 1.18
diff -p -u -r1.18 ds3d.c
--- dlls/dsound/tests/ds3d.c	10 Jan 2005 12:25:56 -0000	1.18
+++ dlls/dsound/tests/ds3d.c	10 Feb 2005 18:54:38 -0000
@@ -628,7 +628,7 @@ static HRESULT test_secondary(LPGUID lpG
     LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
     LPDIRECTSOUND3DLISTENER listener=NULL;
     DSBUFFERDESC bufdesc;
-    WAVEFORMATEX wfx;
+    WAVEFORMATEX wfx, wfx1;
     int ref;
 
     /* Create the DirectSound object */
@@ -659,6 +659,12 @@ static HRESULT test_secondary(LPGUID lpG
         DXGetErrorString8(rc));
 
     if (rc==DS_OK && primary!=NULL) {
+        rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
+        ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
+           DXGetErrorString8(rc));
+        if (rc!=DS_OK)
+            goto EXIT1;
+
         if (has_listener) {
             rc=IDirectSoundBuffer_QueryInterface(primary,
                                                  &IID_IDirectSound3DListener,
@@ -710,7 +716,8 @@ static HRESULT test_secondary(LPGUID lpG
         bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
         bufdesc.lpwfxFormat=&wfx;
         if (winetest_interactive) {
-            trace("  Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n",
+            trace("  Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
+                  "with a primary buffer at %ldx%dx%d\n",
                   has_3dbuffer?"3D ":"",
                   has_duplicate?"duplicated ":"",
                   listener!=NULL||move_sound?"with ":"",
@@ -718,7 +725,8 @@ static HRESULT test_secondary(LPGUID lpG
                   listener!=NULL?"listener ":"",
                   listener&&move_sound?"and moving sound ":move_sound?
                   "moving sound ":"",
-                  wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+                  wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
+                  wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
         }
         rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
         ok(rc==DS_OK && secondary!=NULL,"IDirectSound_CreateSoundBuffer() "
@@ -839,6 +847,7 @@ static HRESULT test_secondary(LPGUID lpG
             }
         }
     }
+EXIT1:
     if (has_listener) {
         ref=IDirectSound3DListener_Release(listener);
         ok(ref==0,"IDirectSound3dListener_Release() listener has %d "
Index: dlls/dsound/tests/ds3d8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/ds3d8.c,v
retrieving revision 1.12
diff -p -u -r1.12 ds3d8.c
--- dlls/dsound/tests/ds3d8.c	10 Jan 2005 12:25:56 -0000	1.12
+++ dlls/dsound/tests/ds3d8.c	10 Feb 2005 18:54:38 -0000
@@ -530,7 +530,7 @@ static HRESULT test_secondary8(LPGUID lp
     LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
     LPDIRECTSOUND3DLISTENER listener=NULL;
     DSBUFFERDESC bufdesc;
-    WAVEFORMATEX wfx;
+    WAVEFORMATEX wfx, wfx1;
     int ref;
 
     /* Create the DirectSound object */
@@ -561,6 +561,12 @@ static HRESULT test_secondary8(LPGUID lp
        DXGetErrorString8(rc));
 
     if (rc==DS_OK && primary!=NULL) {
+        rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
+        ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
+           DXGetErrorString8(rc));
+        if (rc!=DS_OK)
+            goto EXIT1;
+
         if (has_listener) {
             rc=IDirectSoundBuffer_QueryInterface(primary,
                                                  &IID_IDirectSound3DListener,
@@ -624,7 +630,8 @@ static HRESULT test_secondary8(LPGUID lp
         }
 
         if (winetest_interactive) {
-            trace("  Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n",
+            trace("  Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
+                  "with a primary buffer at %ldx%dx%d\n",
                   has_3dbuffer?"3D ":"",
                   has_duplicate?"duplicated ":"",
                   listener!=NULL||move_sound?"with ":"",
@@ -632,7 +639,8 @@ static HRESULT test_secondary8(LPGUID lp
                   listener!=NULL?"listener ":"",
                   listener&&move_sound?"and moving sound ":move_sound?
                   "moving sound ":"",
-                  wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+                  wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
+                  wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
         }
         rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
         ok(rc==DS_OK && secondary!=NULL,"IDirectSound8_CreateSoundBuffer() "
@@ -753,6 +761,7 @@ static HRESULT test_secondary8(LPGUID lp
             }
         }
     }
+EXIT1:
     if (has_listener) {
         ref=IDirectSound3DListener_Release(listener);
         ok(ref==0,"IDirectSound3dListener_Release() listener has %d "
Index: dlls/dsound/tests/dsound.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound.c,v
retrieving revision 1.44
diff -p -u -r1.44 dsound.c
--- dlls/dsound/tests/dsound.c	10 Jan 2005 12:25:56 -0000	1.44
+++ dlls/dsound/tests/dsound.c	10 Feb 2005 18:54:39 -0000
@@ -623,7 +623,7 @@ static HRESULT test_secondary(LPGUID lpG
     LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
     DSBUFFERDESC bufdesc;
     DSCAPS dscaps;
-    WAVEFORMATEX wfx;
+    WAVEFORMATEX wfx, wfx1;
     DWORD f;
     int ref;
 
@@ -659,6 +659,12 @@ static HRESULT test_secondary(LPGUID lpG
        "%s\n",DXGetErrorString8(rc));
 
     if (rc==DS_OK && primary!=NULL) {
+        rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
+        ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
+           DXGetErrorString8(rc));
+        if (rc!=DS_OK)
+            goto EXIT1;
+
         for (f=0;f<NB_FORMATS;f++) {
             init_format(&wfx,WAVE_FORMAT_PCM,formats[f][0],formats[f][1],
                         formats[f][2]);
@@ -681,8 +687,10 @@ static HRESULT test_secondary(LPGUID lpG
             bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
             bufdesc.lpwfxFormat=&wfx;
             if (winetest_interactive) {
-                trace("  Testing a secondary buffer at %ldx%dx%d\n",
-                      wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+                trace("  Testing a secondary buffer at %ldx%dx%d "
+                      "with a primary buffer at %ldx%dx%d\n",
+                      wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
+                      wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
             }
             rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
             ok(rc==DS_OK && secondary!=NULL,
@@ -698,7 +706,7 @@ static HRESULT test_secondary(LPGUID lpG
                    "should have 0\n",ref);
             }
         }
-
+EXIT1:
         ref=IDirectSoundBuffer_Release(primary);
         ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
            "should have 0\n",ref);
Index: dlls/dsound/tests/dsound8.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/tests/dsound8.c,v
retrieving revision 1.14
diff -p -u -r1.14 dsound8.c
--- dlls/dsound/tests/dsound8.c	10 Jan 2005 12:25:56 -0000	1.14
+++ dlls/dsound/tests/dsound8.c	10 Feb 2005 18:54:39 -0000
@@ -644,7 +644,7 @@ static HRESULT test_secondary8(LPGUID lp
     LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
     DSBUFFERDESC bufdesc;
     DSCAPS dscaps;
-    WAVEFORMATEX wfx;
+    WAVEFORMATEX wfx, wfx1;
     DWORD f;
     int ref;
 
@@ -680,6 +680,12 @@ static HRESULT test_secondary8(LPGUID lp
        "%s\n",DXGetErrorString8(rc));
 
     if (rc==DS_OK && primary!=NULL) {
+        rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
+        ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
+           DXGetErrorString8(rc));
+        if (rc!=DS_OK)
+            goto EXIT1;
+
         for (f=0;f<NB_FORMATS;f++) {
             init_format(&wfx,WAVE_FORMAT_PCM,formats[f][0],formats[f][1],
                         formats[f][2]);
@@ -702,8 +708,10 @@ static HRESULT test_secondary8(LPGUID lp
             bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
             bufdesc.lpwfxFormat=&wfx;
             if (winetest_interactive) {
-                trace("  Testing a secondary buffer at %ldx%dx%d\n",
-                      wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
+                trace("  Testing a secondary buffer at %ldx%dx%d "
+                      "with a primary buffer at %ldx%dx%d\n",
+                      wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
+                      wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
             }
             rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
             ok(rc==DS_OK && secondary!=NULL,
@@ -719,7 +727,7 @@ static HRESULT test_secondary8(LPGUID lp
                    "should have 0\n",ref);
             }
         }
-
+EXIT1:
         ref=IDirectSoundBuffer_Release(primary);
         ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
            "should have 0\n",ref);


More information about the wine-patches mailing list