{
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 )
{
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 );
}
} \
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