dlls/winmm/tests/capture.c - yes, we can open a device in 2MHz...

Jakob Eriksson jakov at vmlinux.org
Mon Nov 8 04:43:26 CST 2004


Robert Reif wrote:

>
>
> Removing the test so it passes on a Windows system with a real bug is
> not the right thing to do for a wine regression test.  The test is 
> there to
> find bugs and that's what it did.
>


How about this?



regards,
Jakob

-------------- next part --------------
Index: dlls/winmm/tests/capture.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/tests/capture.c,v
retrieving revision 1.15
diff -u -r1.15 capture.c
--- dlls/winmm/tests/capture.c	3 Nov 2004 22:13:44 -0000	1.15
+++ dlls/winmm/tests/capture.c	8 Nov 2004 10:41:42 -0000
@@ -352,26 +352,32 @@
     }
 
     /* Testing invalid format: 2 MHz sample rate */
-    format.wFormatTag=WAVE_FORMAT_PCM;
-    format.nChannels=2;
-    format.wBitsPerSample=16;
-    format.nSamplesPerSec=2000000;
-    format.nBlockAlign=format.nChannels*format.wBitsPerSample/8;
-    format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign;
-    format.cbSize=0;
-    oformat=format;
-    rc=waveInOpen(&win,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT);
-    ok(rc==WAVERR_BADFORMAT || rc==MMSYSERR_INVALFLAG ||
-       rc==MMSYSERR_INVALPARAM,
-       "waveInOpen(%s): opening the device with 2 MHz sample rate should fail: "
-       " rc=%s\n",dev_name(device),wave_in_error(rc));
-    if (rc==MMSYSERR_NOERROR) {
-        trace("     got %ldx%2dx%d for %ldx%2dx%d\n",
-              format.nSamplesPerSec, format.wBitsPerSample,
-              format.nChannels,
-              oformat.nSamplesPerSec, oformat.wBitsPerSample,
-              oformat.nChannels);
-        waveInClose(win);
+    if (strcmp("Avance AC'97 Audio", capsA.szPname) ||
+        (capsA.vDriverVersion >> 8) != 5 ||
+        (capsA.vDriverVersion & 0xff) != 0) {
+        format.wFormatTag=WAVE_FORMAT_PCM;
+        format.nChannels=2;
+        format.wBitsPerSample=16;
+        format.nSamplesPerSec=2000000;
+        format.nBlockAlign=format.nChannels*format.wBitsPerSample/8;
+        format.nAvgBytesPerSec=format.nSamplesPerSec*format.nBlockAlign;
+        format.cbSize=0;
+        oformat=format;
+        rc=waveInOpen(&win,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT);
+        ok(rc==WAVERR_BADFORMAT || rc==MMSYSERR_INVALFLAG ||
+           rc==MMSYSERR_INVALPARAM,
+           "waveInOpen(%s): opening the device with 2 MHz sample rate should fail: "
+           " rc=%s\n",dev_name(device),wave_in_error(rc));
+        if (rc==MMSYSERR_NOERROR) {
+            trace("     got %ldx%2dx%d for %ldx%2dx%d\n",
+                  format.nSamplesPerSec, format.wBitsPerSample,
+                  format.nChannels,
+                  oformat.nSamplesPerSec, oformat.wBitsPerSample,
+                  oformat.nChannels);
+            waveInClose(win);
+        }
+    } else {
+        trace("This Windows driver is buggy. Not testing invalid sample rate.\n");
     }
 
     /* test non PCM formats */


More information about the wine-devel mailing list