This patch adds support for WINETEST_INTERACTIVE as proposed on wine-dev and modifies the winmm test to use it instead of the 'play' option.
Changelog:
* include/wine/test.h,
dlls/winmm/tests/wave.c
Add support for WINETEST_INTERACTIVE. If set then tests can perform additional explicitly interactive tests.
Modify the winmm test to use WINETEST_INTERACTIVE.
--
Francois Gouget
fgouget@codeweavers.com
Index: include/wine/test.h =================================================================== RCS file: /home/wine/wine/include/wine/test.h,v retrieving revision 1.9 diff -u -r1.9 test.h --- include/wine/test.h 17 Dec 2002 01:47:04 -0000 1.9 +++ include/wine/test.h 26 Dec 2002 21:12:44 -0000 @@ -27,6 +27,9 @@ /* debug level */ extern int winetest_debug; +/* running in interactive mode? */ +extern int winetest_interactive; + /* current platform */ extern const char *winetest_platform; @@ -74,6 +77,9 @@ /* debug level */ int winetest_debug = 1; +/* interactive mode? */ +int winetest_interactive = 0; + /* current platform */ const char *winetest_platform = "windows"; @@ -314,6 +320,7 @@ if ((p = getenv( "WINETEST_PLATFORM" ))) winetest_platform = p; if ((p = getenv( "WINETEST_DEBUG" ))) winetest_debug = atoi(p); + if ((p = getenv( "WINETEST_INTERACTIVE" ))) winetest_interactive = atoi(p); if ((p = getenv( "WINETEST_REPORT_SUCCESS"))) report_success = atoi(p); if (!argv[1]) usage( argv[0] ); Index: dlls/winmm/tests/wave.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/tests/wave.c,v retrieving revision 1.5 diff -u -r1.5 wave.c --- dlls/winmm/tests/wave.c 16 Dec 2002 22:12:32 -0000 1.5 +++ dlls/winmm/tests/wave.c 26 Dec 2002 20:35:13 -0000 @@ -29,14 +29,11 @@ * Note that in most of this test we may get MMSYSERR_BADDEVICEID errors * at about any time if the user starts another application that uses the * sound device. So we should not report these as test failures. - */ - -/* This test can play a test sound. But this only makes sense if someone + * + * This test can play a test tone. But this only makes sense if someone * is going to carefully listen to it, and would only bother everyone else. - * So to play the test sound you have to pass the 'play' parameter: - * winmm_test wave play + * So this is only done if the test is being run in interactive mode. */ -static int play_la; static const unsigned int win_formats[][4]={ {WAVE_FORMAT_1M08, 11025, 8, 1}, @@ -149,7 +146,7 @@ ok(rc==MMSYSERR_NOERROR, "waveOutPrepareHeader: device=%d rc=%d\n",device,rc); - if (play_la && rc==MMSYSERR_NOERROR) { + if (winetest_interactive && rc==MMSYSERR_NOERROR) { trace("Playing 440Hz LA at %ldx%2dx%d %04lx\n", wfx.nSamplesPerSec, wfx.wBitsPerSample,wfx.nChannels,flags); rc=waveOutSetVolume(wout,0x20002000); @@ -263,10 +260,5 @@ START_TEST(wave) { - int argc; - char** argv; - argc = winetest_get_mainargs(&argv); - play_la=(argc >= 3 && strcmp(argv[2],"play")==0); - wave_out_tests(); }