From: Phil Burk Date: Wed, 27 Jul 2016 02:10:23 +0000 (-0700) Subject: Loopback: fix warnings that prevent compilation X-Git-Tag: pa_stable_v190600_20161030~16^2 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=cf4ef2ce1907e71179facb4107769df70cf8559e;p=portaudio Loopback: fix warnings that prevent compilation Add newline in biquad_filter.c Add integer assert with tolerance. --- diff --git a/qa/loopback/src/biquad_filter.c b/qa/loopback/src/biquad_filter.c index 0566085..1bc4a23 100755 --- a/qa/loopback/src/biquad_filter.c +++ b/qa/loopback/src/biquad_filter.c @@ -119,4 +119,4 @@ void BiquadFilter_Filter( BiquadFilter *filter, float *inputs, float *outputs, i filter->xn2 = xn2; filter->yn1 = yn1; filter->yn2 = yn2; -} \ No newline at end of file +} diff --git a/qa/loopback/src/paqa.c b/qa/loopback/src/paqa.c index ad654db..cb7100d 100644 --- a/qa/loopback/src/paqa.c +++ b/qa/loopback/src/paqa.c @@ -890,10 +890,10 @@ static int PaQa_SingleLoopBackTest( UserOptions *userOptions, TestParameters *te { printf( "OK" ); } - - printf( "\n" ); - - + + // Print the # errors so far to make it easier to see where the error occured. + printf( " - #errs = %d\n", g_testsFailed ); + PaQa_TeardownLoopbackContext( &loopbackContext ); if( numBadChannels > 0 ) { @@ -1376,25 +1376,25 @@ int TestSampleFormatConversion( void ) PaQa_ConvertFromFloat( floatInput, 4, paUInt8, ucharOutput ); for( i=0; i<4; i++ ) { - QA_ASSERT_CLOSE( "paFloat32 -> paUInt8 -> error", ucharInput[i], ucharOutput[i], 1 ); + QA_ASSERT_CLOSE_INT( "paFloat32 -> paUInt8 -> error", ucharInput[i], ucharOutput[i], 1 ); } PaQa_ConvertFromFloat( floatInput, 4, paInt8, charOutput ); for( i=0; i<4; i++ ) { - QA_ASSERT_CLOSE( "paFloat32 -> paInt8 -> error", charInput[i], charOutput[i], 1 ); + QA_ASSERT_CLOSE_INT( "paFloat32 -> paInt8 -> error", charInput[i], charOutput[i], 1 ); } PaQa_ConvertFromFloat( floatInput, 4, paInt16, shortOutput ); for( i=0; i<4; i++ ) { - QA_ASSERT_CLOSE( "paFloat32 -> paInt16 error", shortInput[i], shortOutput[i], 1 ); + QA_ASSERT_CLOSE_INT( "paFloat32 -> paInt16 error", shortInput[i], shortOutput[i], 1 ); } PaQa_ConvertFromFloat( floatInput, 4, paInt32, intOutput ); for( i=0; i<4; i++ ) { - QA_ASSERT_CLOSE( "paFloat32 -> paInt32 error", intInput[i], intOutput[i], 0x00010000 ); + QA_ASSERT_CLOSE_INT( "paFloat32 -> paInt32 error", intInput[i], intOutput[i], 0x00010000 ); } diff --git a/qa/loopback/src/qa_tools.h b/qa/loopback/src/qa_tools.h index 1f33224..320236e 100755 --- a/qa/loopback/src/qa_tools.h +++ b/qa/loopback/src/qa_tools.h @@ -70,5 +70,14 @@ extern int g_testsFailed; } \ else g_testsPassed++; +#define QA_ASSERT_CLOSE_INT( message, expected, actual, tolerance ) \ + if (abs((expected)-(actual))>(tolerance)) \ + { \ + printf( "%s:%d - ERROR - %s, expected %d, got %d, tol=%d\n", __FILE__, __LINE__, message, ((int)(expected)), ((int)(actual)), ((int)(tolerance)) ); \ + g_testsFailed++; \ + goto error; \ + } \ + else g_testsPassed++; + #endif