From 88a5cb569bc5c065de1f26fb0784ee88a01ce199 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 2 Jan 2003 17:52:05 +0000 Subject: [PATCH] Add support for WINETEST_INTERACTIVE. If set then tests can perform additional explicitly interactive tests. Modify the winmm test to use WINETEST_INTERACTIVE. --- dlls/winmm/tests/wave.c | 16 ++++------------ include/wine/test.h | 7 +++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c index 136d84936e9..6138385adc2 100644 --- a/dlls/winmm/tests/wave.c +++ b/dlls/winmm/tests/wave.c @@ -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 @@ static void wave_out_test_deviceOut(int device, int format, DWORD flags) 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 @@ static void wave_out_tests() START_TEST(wave) { - int argc; - char** argv; - argc = winetest_get_mainargs(&argv); - play_la=(argc >= 3 && strcmp(argv[2],"play")==0); - wave_out_tests(); } diff --git a/include/wine/test.h b/include/wine/test.h index 4013992f1f2..b982e2d8bf3 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -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 @@ extern void winetest_trace( const char *msg, ... ); /* debug level */ int winetest_debug = 1; +/* interactive mode? */ +int winetest_interactive = 0; + /* current platform */ const char *winetest_platform = "windows"; @@ -314,6 +320,7 @@ int main( int argc, char **argv ) 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] );