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
|
|
@ -26,13 +26,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.
|
||||
*/
|
||||
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#define _WIN32_WINNT 0x0501 /* for GetNativeSystemInfo */
|
||||
#define _WIN32_WINNT 0x0501 /* for GetNativeSystemInfo */
|
||||
#include <windows.h>
|
||||
//#include <mmsystem.h> /* required when using pa_win_wmme.h */
|
||||
|
||||
|
|
@ -102,11 +102,11 @@ static void printWindowsVersionInfo( FILE *fp )
|
|||
osVersionInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
GetVersionEx( &osVersionInfoEx );
|
||||
|
||||
|
||||
|
||||
if( osVersionInfoEx.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ){
|
||||
switch( osVersionInfoEx.dwMinorVersion ){
|
||||
case 0: osName = "Windows 95"; break;
|
||||
case 10: osName = "Windows 98"; break; // could also be 98SE (I've seen code discriminate based
|
||||
case 10: osName = "Windows 98"; break; // could also be 98SE (I've seen code discriminate based
|
||||
// on osInfo.Version.Revision.ToString() == "2222A")
|
||||
case 90: osName = "Windows Me"; break;
|
||||
}
|
||||
|
|
@ -132,13 +132,13 @@ static void printWindowsVersionInfo( FILE *fp )
|
|||
}break;
|
||||
}break;
|
||||
case 6:switch( osVersionInfoEx.dwMinorVersion ){
|
||||
case 0:
|
||||
case 0:
|
||||
if( osVersionInfoEx.wProductType == VER_NT_WORKSTATION )
|
||||
osName = "Windows Vista";
|
||||
else
|
||||
osName = "Windows Server 2008";
|
||||
break;
|
||||
case 1:
|
||||
case 1:
|
||||
if( osVersionInfoEx.wProductType == VER_NT_WORKSTATION )
|
||||
osName = "Windows 7";
|
||||
else
|
||||
|
|
@ -166,7 +166,7 @@ static void printWindowsVersionInfo( FILE *fp )
|
|||
}
|
||||
else if(osVersionInfoEx.wProductType == VER_NT_SERVER)
|
||||
{
|
||||
if(osVersionInfoEx.dwMinorVersion == 0)
|
||||
if(osVersionInfoEx.dwMinorVersion == 0)
|
||||
{
|
||||
if((osVersionInfoEx.wSuiteMask & VER_SUITE_DATACENTER) == VER_SUITE_DATACENTER)
|
||||
osProductType = "Datacenter Server"; // Windows 2000 Datacenter Server
|
||||
|
|
@ -201,8 +201,8 @@ static void printWindowsVersionInfo( FILE *fp )
|
|||
|
||||
|
||||
fprintf( fp, "OS name and edition: %s %s\n", osName, osProductType );
|
||||
fprintf( fp, "OS version: %d.%d.%d %S\n",
|
||||
osVersionInfoEx.dwMajorVersion, osVersionInfoEx.dwMinorVersion,
|
||||
fprintf( fp, "OS version: %d.%d.%d %S\n",
|
||||
osVersionInfoEx.dwMajorVersion, osVersionInfoEx.dwMinorVersion,
|
||||
osVersionInfoEx.dwBuildNumber, osVersionInfoEx.szCSDVersion );
|
||||
fprintf( fp, "Processor architecture: %s\n", processorArchitecture );
|
||||
fprintf( fp, "WoW64 process: %s\n", IsWow64() ? "Yes" : "No" );
|
||||
|
|
@ -225,7 +225,7 @@ static void printTimeAndDate( FILE *fp )
|
|||
typedef struct
|
||||
{
|
||||
float sine[TABLE_SIZE];
|
||||
double phase;
|
||||
double phase;
|
||||
double phaseIncrement;
|
||||
volatile int fadeIn;
|
||||
volatile int fadeOut;
|
||||
|
|
@ -252,14 +252,14 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||
(void) timeInfo; /* Prevent unused variable warnings. */
|
||||
(void) statusFlags;
|
||||
(void) inputBuffer;
|
||||
|
||||
|
||||
for( i=0; i<framesPerBuffer; i++ )
|
||||
{
|
||||
float x = data->sine[(int)data->phase];
|
||||
data->phase += data->phaseIncrement;
|
||||
if( data->phase >= TABLE_SIZE ){
|
||||
data->phase -= TABLE_SIZE;
|
||||
}
|
||||
data->phase -= TABLE_SIZE;
|
||||
}
|
||||
|
||||
x *= data->amp;
|
||||
if( data->fadeIn ){
|
||||
|
|
@ -271,11 +271,11 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||
data->amp -= .001;
|
||||
}
|
||||
|
||||
for( j = 0; j < CHANNEL_COUNT; ++j ){
|
||||
for( j = 0; j < CHANNEL_COUNT; ++j ){
|
||||
*out++ = x;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if( data->amp > 0 )
|
||||
return paContinue;
|
||||
else
|
||||
|
|
@ -287,7 +287,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
|||
#define NO 0
|
||||
|
||||
|
||||
static int playUntilKeyPress( int deviceIndex, float sampleRate,
|
||||
static int playUntilKeyPress( int deviceIndex, float sampleRate,
|
||||
int framesPerUserBuffer, int framesPerDSoundBuffer )
|
||||
{
|
||||
PaStreamParameters outputParameters;
|
||||
|
|
@ -303,7 +303,7 @@ static int playUntilKeyPress( int deviceIndex, float sampleRate,
|
|||
outputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
directSoundStreamInfo.size = sizeof(PaWinDirectSoundStreamInfo);
|
||||
directSoundStreamInfo.hostApiType = paDirectSound;
|
||||
directSoundStreamInfo.hostApiType = paDirectSound;
|
||||
directSoundStreamInfo.version = 2;
|
||||
directSoundStreamInfo.flags = paWinDirectSoundUseLowLevelLatencyParameters;
|
||||
directSoundStreamInfo.framesPerBuffer = framesPerDSoundBuffer;
|
||||
|
|
@ -373,7 +373,7 @@ static void usage( int dsoundHostApiIndex )
|
|||
}
|
||||
|
||||
/*
|
||||
ideas:
|
||||
ideas:
|
||||
o- could be testing with 80% CPU load
|
||||
o- could test with different channel counts
|
||||
*/
|
||||
|
|
@ -401,15 +401,15 @@ int main(int argc, char* argv[])
|
|||
if( argc > 3 )
|
||||
usage(dsoundHostApiIndex);
|
||||
|
||||
deviceIndex = dsoundHostApiInfo->defaultOutputDevice;
|
||||
if( argc >= 2 ){
|
||||
deviceIndex = dsoundHostApiInfo->defaultOutputDevice;
|
||||
if( argc >= 2 ){
|
||||
deviceIndex = -1;
|
||||
if( sscanf( argv[1], "%d", &deviceIndex ) != 1 )
|
||||
if( sscanf( argv[1], "%d", &deviceIndex ) != 1 )
|
||||
usage(dsoundHostApiInfo);
|
||||
if( deviceIndex < 0 || deviceIndex >= Pa_GetDeviceCount() || Pa_GetDeviceInfo(deviceIndex)->hostApi != dsoundHostApiIndex ){
|
||||
usage(dsoundHostApiInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf( "Using device id %d (%s)\n", deviceIndex, Pa_GetDeviceInfo(deviceIndex)->name );
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
printf( "Testing with sample rate %f.\n", (float)sampleRate );
|
||||
|
||||
|
||||
|
||||
|
||||
/* initialise sinusoidal wavetable */
|
||||
for( i=0; i<TABLE_SIZE; i++ )
|
||||
|
|
@ -428,14 +428,14 @@ int main(int argc, char* argv[])
|
|||
data.sine[i] = (float) sin( ((double)i/(double)TABLE_SIZE) * M_PI * 2. );
|
||||
}
|
||||
|
||||
data.phase = 0;
|
||||
data.phase = 0;
|
||||
|
||||
resultsFp = fopen( "results.txt", "at" );
|
||||
fprintf( resultsFp, "*** DirectSound smallest working output buffer sizes\n" );
|
||||
|
||||
printTimeAndDate( resultsFp );
|
||||
printWindowsVersionInfo( resultsFp );
|
||||
|
||||
|
||||
fprintf( resultsFp, "audio device: %s\n", Pa_GetDeviceInfo( deviceIndex )->name );
|
||||
fflush( resultsFp );
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ int main(int argc, char* argv[])
|
|||
}else{
|
||||
min = mid + 1;
|
||||
}
|
||||
|
||||
|
||||
}while( (min <= max) && (testResult == YES || testResult == NO) );
|
||||
|
||||
smallestWorkingBufferingLatencyFrames = smallestWorkingBufferSize; /* not strictly true, but we're using an unspecified callback size, so kind of */
|
||||
|
|
@ -490,7 +490,7 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
}while( (dsoundBufferSize <= (int)(sampleRate * .3)) && testResult == NO );
|
||||
|
||||
|
||||
smallestWorkingBufferingLatencyFrames = smallestWorkingBufferSize; /* not strictly true, but we're using an unspecified callback size, so kind of */
|
||||
|
||||
fprintf( resultsFp, "%d, %d, %f\n", smallestWorkingBufferSize, smallestWorkingBufferingLatencyFrames, smallestWorkingBufferingLatencyFrames / sampleRate );
|
||||
|
|
@ -499,10 +499,10 @@ int main(int argc, char* argv[])
|
|||
|
||||
fprintf( resultsFp, "###\n" );
|
||||
fclose( resultsFp );
|
||||
|
||||
|
||||
Pa_Terminate();
|
||||
printf("Test finished.\n");
|
||||
|
||||
|
||||
return err;
|
||||
error:
|
||||
Pa_Terminate();
|
||||
|
|
|
|||
Loading…
Reference in a new issue