Show
Ignore:
Timestamp:
02/29/08 19:38:27 (9 months ago)
Author:
rossb
Message:

patch from magnus jonsson to print error instead of crash in tests when there is no default input (or output) device. changes to paqa_errs are related to ticket #61

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • portaudio/branches/v19-devel/test/pa_fuzz.c

    r1097 r1368  
    132132    if( err != paNoError ) goto error; 
    133133 
    134  
    135134    inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */ 
     135    if (inputParameters.device == paNoDevice) { 
     136      fprintf(stderr,"Error: No default input device.\n"); 
     137      goto error; 
     138    } 
    136139    inputParameters.channelCount = 2;       /* stereo input */ 
    137140    inputParameters.sampleFormat = PA_SAMPLE_TYPE; 
     
    140143 
    141144    outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */ 
     145    if (outputParameters.device == paNoDevice) { 
     146      fprintf(stderr,"Error: No default output device.\n"); 
     147      goto error; 
     148    } 
    142149    outputParameters.channelCount = 2;       /* stereo output */ 
    143150    outputParameters.sampleFormat = PA_SAMPLE_TYPE;