PortAudio  2.0
Macros | Variables
qa_tools.h File Reference

Go to the source code of this file.

Macros

#define QA_ASSERT_TRUE(message, flag)
 
#define QA_ASSERT_EQUALS(message, expected, actual)
 
#define QA_ASSERT_CLOSE(message, expected, actual, tolerance)
 
#define QA_ASSERT_CLOSE_INT(message, expected, actual, tolerance)
 

Variables

int g_testsPassed
 
int g_testsFailed
 

Macro Definition Documentation

#define QA_ASSERT_CLOSE (   message,
  expected,
  actual,
  tolerance 
)
Value:
if (fabs((expected)-(actual))>(tolerance)) \
{ \
printf( "%s:%d - ERROR - %s, expected %f, got %f, tol=%f\n", __FILE__, __LINE__, message, ((double)(expected)), ((double)(actual)), ((double)(tolerance)) ); \
goto error; \
} \
else g_testsPassed++;
int g_testsPassed
Definition: paqa.c:54
int g_testsFailed
Definition: paqa.c:55

Referenced by TestSampleFormatConversion().

#define QA_ASSERT_CLOSE_INT (   message,
  expected,
  actual,
  tolerance 
)
Value:
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)) ); \
goto error; \
} \
else g_testsPassed++;
int g_testsPassed
Definition: paqa.c:54
int g_testsFailed
Definition: paqa.c:55

Referenced by TestSampleFormatConversion().

#define QA_ASSERT_EQUALS (   message,
  expected,
  actual 
)
Value:
if( ((expected) != (actual)) ) \
{ \
printf( "%s:%d - ERROR - %s, expected %d, got %d\n", __FILE__, __LINE__, message, expected, actual ); \
goto error; \
} \
else g_testsPassed++;
int g_testsPassed
Definition: paqa.c:54
int g_testsFailed
Definition: paqa.c:55

Referenced by PaQa_AnalyseRecording(), PaQa_DetectPop(), and TestSampleFormatConversion().

#define QA_ASSERT_TRUE (   message,
  flag 
)
Value:
if( !(flag) ) \
{ \
printf( "%s:%d - ERROR - %s\n", __FILE__, __LINE__, message ); \
goto error; \
} \
else g_testsPassed++;
int g_testsPassed
Definition: paqa.c:54
int g_testsFailed
Definition: paqa.c:55

Referenced by PaQa_CheckForLoopBack(), PaQa_CompareAmplitudes(), PaQa_CorrelateSine(), PaQa_FindFirstMatch(), PaQa_InitializeRecording(), and PaQa_MeasureLatency().

Variable Documentation

int g_testsFailed

Referenced by main().

int g_testsPassed

Accumulate counts for how many tests pass or fail.

Referenced by main().