Clean up whitespace in test/ in preparation for .editorconfig. (#417)
* Clean up whitespace in test/ in preparation for .editorconfig. Convert tabs to 4 spaces. Indent by 4 spaces. Strip trailing whitespace. Ensure EOL at EOF.
This commit is contained in:
parent
b251bdd7f8
commit
f58b69dc36
45 changed files with 998 additions and 998 deletions
|
|
@ -1,9 +1,9 @@
|
|||
/** @file patest_toomanysines.c
|
||||
@ingroup test_src
|
||||
@brief Play more sine waves than we can handle in real time as a stress test.
|
||||
@ingroup test_src
|
||||
@brief Play more sine waves than we can handle in real time as a stress test.
|
||||
@todo This may not be needed now that we have "patest_out_overflow.c".
|
||||
@author Ross Bencina <rossb@audiomulch.com>
|
||||
@author Phil Burk <philburk@softsynth.com>
|
||||
@author Ross Bencina <rossb@audiomulch.com>
|
||||
@author Phil Burk <philburk@softsynth.com>
|
||||
*/
|
||||
/*
|
||||
* $Id$
|
||||
|
|
@ -33,13 +33,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ int main(void)
|
|||
|
||||
err = Pa_Initialize();
|
||||
if( err != paNoError ) goto error;
|
||||
|
||||
|
||||
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
|
||||
if (outputParameters.device == paNoDevice) {
|
||||
fprintf(stderr,"Error: No default output device.\n");
|
||||
|
|
@ -139,7 +139,7 @@ int main(void)
|
|||
FRAMES_PER_BUFFER,
|
||||
paClipOff, /* we won't output out of range samples so don't bother clipping them */
|
||||
patestCallback,
|
||||
&data );
|
||||
&data );
|
||||
if( err != paNoError ) goto error;
|
||||
err = Pa_StartStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
|
|
@ -150,44 +150,44 @@ int main(void)
|
|||
|
||||
load = Pa_GetStreamCpuLoad( stream );
|
||||
printf("numSines = %d, CPU load = %f\n", data.numSines, load );
|
||||
|
||||
if( load < 0.3 )
|
||||
{
|
||||
data.numSines += 10;
|
||||
}
|
||||
else if( load < 0.4 )
|
||||
{
|
||||
data.numSines += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.numSines += 1;
|
||||
}
|
||||
|
||||
|
||||
if( load < 0.3 )
|
||||
{
|
||||
data.numSines += 10;
|
||||
}
|
||||
else if( load < 0.4 )
|
||||
{
|
||||
data.numSines += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.numSines += 1;
|
||||
}
|
||||
|
||||
}
|
||||
while( load < 0.5 );
|
||||
|
||||
|
||||
/* Calculate target stress value then ramp up to that level*/
|
||||
numStress = (int) (2.0 * data.numSines * MAX_LOAD );
|
||||
if( numStress > MAX_SINES )
|
||||
numStress = MAX_SINES;
|
||||
numStress = MAX_SINES;
|
||||
for( ; data.numSines < numStress; data.numSines+=2 )
|
||||
{
|
||||
Pa_Sleep( 200 );
|
||||
load = Pa_GetStreamCpuLoad( stream );
|
||||
printf("STRESSING: numSines = %d, CPU load = %f\n", data.numSines, load );
|
||||
}
|
||||
|
||||
|
||||
printf("Suffer for 5 seconds.\n");
|
||||
Pa_Sleep( 5000 );
|
||||
|
||||
|
||||
printf("Stop stream.\n");
|
||||
err = Pa_StopStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
|
||||
|
||||
err = Pa_CloseStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
|
||||
|
||||
Pa_Terminate();
|
||||
printf("Test finished.\n");
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue