Go to the documentation of this file.
2 #ifndef PORTAUDIO_QA_PAQA_MACROS_H
3 #define PORTAUDIO_QA_PAQA_MACROS_H
9 #define PAQA_INSTANTIATE_GLOBALS\
10 int paQaNumPassed = 0;\
11 int paQaNumFailed = 0;
16 #define ASSERT_TRUE(_exp) \
23 printf("ERROR at %s:%d, (%s) not true\n", \
24 __FILE__, __LINE__, #_exp ); \
30 #define ASSERT_AB(_a, _b, _op, _opn) \
39 printf("ERROR at %s:%d, (%s) %s (%s), %d %s %d\n", \
40 __FILE__, __LINE__, #_a, #_opn, #_b, mA, #_opn, mB ); \
46 #define ASSERT_EQ(_a, _b) ASSERT_AB(_a, _b, ==, !=)
47 #define ASSERT_NE(_a, _b) ASSERT_AB(_a, _b, !=, ==)
48 #define ASSERT_GT(_a, _b) ASSERT_AB(_a, _b, >, <=)
49 #define ASSERT_GE(_a, _b) ASSERT_AB(_a, _b, >=, <)
50 #define ASSERT_LT(_a, _b) ASSERT_AB(_a, _b, <, >=)
51 #define ASSERT_LE(_a, _b) ASSERT_AB(_a, _b, <=, >)
53 #define HOPEFOR(_exp) \
60 printf("\nERROR - 0x%x - %s for %s\n", result, Pa_GetErrorText(result), #_exp ); \
65 #define PAQA_PRINT_RESULT \
66 printf("QA Report: %d passed, %d failed.\n", paQaNumPassed, paQaNumFailed )
68 #define PAQA_EXIT_RESULT \
69 (((paQaNumFailed > 0) || (paQaNumPassed == 0)) ? EXIT_FAILURE : EXIT_SUCCESS)