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,7 +1,7 @@
|
|||
/** @file patest_converters.c
|
||||
@ingroup test_src
|
||||
@brief Tests the converter functions in pa_converters.c
|
||||
@author Ross Bencina <rossb@audiomulch.com>
|
||||
@ingroup test_src
|
||||
@brief Tests the converter functions in pa_converters.c
|
||||
@author Ross Bencina <rossb@audiomulch.com>
|
||||
|
||||
Link with pa_dither.c and pa_converters.c
|
||||
|
||||
|
|
@ -35,13 +35,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.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
|
@ -65,14 +65,14 @@
|
|||
|
||||
#define SAMPLE_FORMAT_COUNT (6)
|
||||
|
||||
static PaSampleFormat sampleFormats_[ SAMPLE_FORMAT_COUNT ] =
|
||||
static PaSampleFormat sampleFormats_[ SAMPLE_FORMAT_COUNT ] =
|
||||
{ paFloat32, paInt32, paInt24, paInt16, paInt8, paUInt8 }; /* all standard PA sample formats */
|
||||
|
||||
static const char* sampleFormatNames_[SAMPLE_FORMAT_COUNT] =
|
||||
static const char* sampleFormatNames_[SAMPLE_FORMAT_COUNT] =
|
||||
{ "paFloat32", "paInt32", "paInt24", "paInt16", "paInt8", "paUInt8" };
|
||||
|
||||
|
||||
static const char* abbreviatedSampleFormatNames_[SAMPLE_FORMAT_COUNT] =
|
||||
static const char* abbreviatedSampleFormatNames_[SAMPLE_FORMAT_COUNT] =
|
||||
{ "f32", "i32", "i24", "i16", " i8", "ui8" };
|
||||
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ static void GenerateOneCycleSine( PaSampleFormat format, void *buffer, int frame
|
|||
unsigned char *out = (unsigned char*)buffer;
|
||||
for( i=0; i < frameCount; ++i ){
|
||||
signed long temp = (PaInt32)(.9 * sin( ((double)i/(double)frameCount) * 2. * M_PI ) * 0x7FFFFFFF);
|
||||
|
||||
|
||||
#if defined(PA_LITTLE_ENDIAN)
|
||||
out[0] = (unsigned char)(temp >> 8) & 0xFF;
|
||||
out[1] = (unsigned char)(temp >> 16) & 0xFF;
|
||||
|
|
@ -193,11 +193,11 @@ int TestNonZeroPresent( void *buffer, int size )
|
|||
int i;
|
||||
|
||||
for( i=0; i < size; ++i ){
|
||||
|
||||
|
||||
if( *p != 0 )
|
||||
return 1;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -213,7 +213,7 @@ float MaximumAbsDifference( float* sourceBuffer, float* referenceBuffer, int cou
|
|||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
int main( const char **argv, int argc )
|
||||
{
|
||||
|
|
@ -286,7 +286,7 @@ int main( const char **argv, int argc )
|
|||
passFailMatrix[sourceFormatIndex][destinationFormatIndex] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* try to measure the noise floor (comparing output signal to a float32 sine wave) */
|
||||
|
||||
if( passFailMatrix[sourceFormatIndex][destinationFormatIndex] ){
|
||||
|
|
@ -298,9 +298,9 @@ int main( const char **argv, int argc )
|
|||
(*converter)( sourceBuffer, 1, destinationBuffer, 1, MAX_PER_CHANNEL_FRAME_COUNT, &ditherState );
|
||||
|
||||
if( TestNonZeroPresent( sourceBuffer, MAX_PER_CHANNEL_FRAME_COUNT * My_Pa_GetSampleSize( paFloat32 ) ) ){
|
||||
|
||||
|
||||
noiseAmplitudeMatrix[sourceFormatIndex][destinationFormatIndex] = MaximumAbsDifference( (float*)sourceBuffer, (float*)referenceBuffer, MAX_PER_CHANNEL_FRAME_COUNT );
|
||||
|
||||
|
||||
}else{
|
||||
/* can't test noise floor because there is no conversion from dest format to float available */
|
||||
noiseAmplitudeMatrix[sourceFormatIndex][destinationFormatIndex] = -1; // mark as failed
|
||||
|
|
|
|||
Loading…
Reference in a new issue