Add some secondary buffer volume checks

Francois Gouget fgouget at codeweavers.com
Fri Jul 23 12:40:33 CDT 2004


Changelog:

  * dlls/dsound/tests/ds3d.c

    Francois Gouget <fgouget at codeweavers.com>
    Check that modifying the secondary buffer volume/pan does not change 
the primary buffer's volume and pan.

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: dlls/dsound/tests/ds3d.c
===================================================================
RCS file: /var/cvs/wine/dlls/dsound/tests/ds3d.c,v
retrieving revision 1.4
diff -u -r1.4 ds3d.c
--- dlls/dsound/tests/ds3d.c	19 Jul 2004 21:20:38 -0000	1.4
+++ dlls/dsound/tests/ds3d.c	23 Jul 2004 13:48:40 -0000
@@ -593,6 +625,49 @@
         rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
         ok(rc==DS_OK && secondary!=NULL,"CreateSoundBuffer failed to create a 3D secondary buffer 0x%lx\n",rc);
         if (rc==DS_OK && secondary!=NULL) {
+            if (!has_3d)
+            {
+                DWORD refvol,refpan,vol,pan;
+
+                /* Check the initial secondary buffer's volume and pan */
+                rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
+                ok(rc==DS_OK,"GetVolume(secondary) failed: %s\n",DXGetErrorString8(rc));
+                ok(vol==0,"wrong volume for a new secondary buffer: %ld\n",vol);
+                rc=IDirectSoundBuffer_GetPan(secondary,&pan);
+                ok(rc==DS_OK,"GetPan(secondary) failed: %s\n",DXGetErrorString8(rc));
+                ok(pan==0,"wrong pan for a new secondary buffer: %ld\n",pan);
+
+                /* Check that changing the secondary buffer's volume and pan
+                 * does not impact the primary buffer's volume and pan
+                 */
+                rc=IDirectSoundBuffer_GetVolume(primary,&refvol);
+                ok(rc==DS_OK,"GetVolume(primary) failed: %s\n",DXGetErrorString8(rc));
+                rc=IDirectSoundBuffer_GetPan(primary,&refpan);
+                ok(rc==DS_OK,"GetPan(primary) failed: %s\n",DXGetErrorString8(rc));
+
+                rc=IDirectSoundBuffer_SetVolume(secondary,-1000);
+                ok(rc==DS_OK,"SetVolume(secondary) failed: %s\n",DXGetErrorString8(rc));
+                rc=IDirectSoundBuffer_GetVolume(secondary,&vol);
+                ok(rc==DS_OK,"SetVolume(secondary) failed: %s\n",DXGetErrorString8(rc));
+                ok(vol==-1000,"secondary: wrong volume %ld instead of -1000\n",vol);
+                rc=IDirectSoundBuffer_SetPan(secondary,-1000);
+                ok(rc==DS_OK,"SetPan(secondary) failed: %s\n",DXGetErrorString8(rc));
+                rc=IDirectSoundBuffer_GetPan(secondary,&pan);
+                ok(rc==DS_OK,"SetPan(secondary) failed: %s\n",DXGetErrorString8(rc));
+                ok(vol==-1000,"secondary: wrong pan %ld instead of -1000\n",pan);
+
+                rc=IDirectSoundBuffer_GetVolume(primary,&vol);
+                ok(rc==DS_OK,"GetVolume(primary) failed: %s\n",DXGetErrorString8(rc));
+                ok(vol==refvol,"The primary volume changed from %ld to %ld\n",refvol,vol);
+                rc=IDirectSoundBuffer_GetPan(primary,&pan);
+                ok(rc==DS_OK,"GetPan(primary) failed: %s\n",DXGetErrorString8(rc));
+                ok(pan==refpan,"The primary pan changed from %ld to %ld\n",refpan,pan);
+
+                rc=IDirectSoundBuffer_SetVolume(secondary,0);
+                ok(rc==DS_OK,"SetVolume(secondary) failed: %s\n",DXGetErrorString8(rc));
+                rc=IDirectSoundBuffer_SetPan(secondary,0);
+                ok(rc==DS_OK,"SetPan(secondary) failed: %s\n",DXGetErrorString8(rc));
+            }
             if (has_duplicate) {
                 LPDIRECTSOUNDBUFFER duplicated=NULL;
 


More information about the wine-patches mailing list