winmm/tests: Avoid spurious test failures on Windows.

Michael Stefaniuc mstefani at redhat.de
Tue Feb 4 06:30:57 CST 2014


---
I have looked at the tests from 2013-09-05 (22fc22d28b65) to 2013-11-01
(37389cfc8003) and while all windows hosts are on average above 400ms
sqlite> select avg(time),host from mci group by host order by avg(time);
414.891304347826|vista_newtb-wvista
421.0|win8_newtb-w81
422.488372093023|win7_newtb-w7pro64-64
423.304347826087|win7_newtb-w7pro64-32
423.423076923077|win8_newtb-w864-64
431.809523809524|win8_newtb-w864-32
438.307692307692|win7_newtb-w7u
...

But they do fall on individual runs below 400ms
sqlite> select count(host), host from mci where time < 400 group by host
order by host;
10|vista_newtb-wvista
1|win7_fg-win7u64-1sp
1|win7_fg-win7u64-1spie9-ja
10|win7_newtb-w7pro64-32
9|win7_newtb-w7pro64-64
1|win8_newtb-w8
1|win8_newtb-w864-32
1|win8_newtb-w864-64
1|xp_fg-winxp-3sp

Most of them stay above 390ms but on occasion they go lower but never
below 350ms.
sqlite> select min(time), host from mci;
368|xp_fg-winxp-3sp

Wine on the other hand is always >= 1000ms.




 dlls/winmm/tests/mci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
index 1ce0260..6a68b41 100644
--- a/dlls/winmm/tests/mci.c
+++ b/dlls/winmm/tests/mci.c
@@ -986,14 +986,14 @@ static void test_asyncWAVE(HWND hwnd)
     /* Check that the 2s sound plays at a normal pace, giving a wide margin to
      * account for timing granularity and small delays.
      */
-    todo_wine ok(400 <= p2 && p2 <= 600, "%ums is not in the expected 400-600ms range\n", p2);
+    todo_wine ok(350 <= p2 && p2 <= 600, "%ums is not in the expected 350-600ms range\n", p2);
     /* Wine's asynchronous thread needs some time to start up. Furthermore, it
      * uses 3 buffers per second, so that the positions reported will be 333ms,
      * 667ms etc. at best, which is why it fails the above test. So add a
      * second test specifically to prevent Wine from getting even worse.
      * FIXME: To be removed when Wine is fixed and passes the above test.
      */
-    ok(400 <= p2 && p2 <= 1000, "%ums is not even in the expected 400-1000ms range\n", p2);
+    ok(350 <= p2 && p2 <= 1000, "%ums is not even in the expected 350-1000ms range\n", p2);
     test_notification(hwnd,"play (nowait)",0);
 
     err = mciSendStringA("pause mysound wait", NULL, 0, hwnd);
-- 
1.8.3.1



More information about the wine-patches mailing list