diff --git a/dap_test.h b/dap_test.h index 8dd354ffc827625efe9cb927162d74bc1664499f..929604f495ac0a0b2c8300326f52d80c3fa599e8 100755 --- a/dap_test.h +++ b/dap_test.h @@ -19,57 +19,52 @@ /** * @brief Can be used like debug info during write test */ -#define dap_test_msg(...) \ +#define dap_test_msg(...) { \ printf("\t%s", TEXT_COLOR_WHT); \ printf(__VA_ARGS__); \ printf("%s\n", TEXT_COLOR_RESET); \ - fflush(stdout); + fflush(stdout); } -#define dap_fail(msg) \ +#define dap_fail(msg) {\ printf("\t%s%s!%s\n", TEXT_COLOR_RED, msg, TEXT_COLOR_RESET); \ - abort(); + abort();} /* PIF - print if failed. For checking value in loop, for don't repeat output */ /** * @brief PIF - print if failed. For checking value in loop, for don't repeat output */ -#define dap_assert_PIF(expr, msg) \ +#define dap_assert_PIF(expr, msg) { \ if(expr) {} \ else { \ printf("\t%s%s FAILED!%s\n", TEXT_COLOR_RED, msg, TEXT_COLOR_RESET); \ - abort(); } + abort(); } } /** * @brief */ -#define dap_assert(expr, testname) \ +#define dap_assert(expr, testname) { \ if(expr) { \ printf("\t%s%s PASS.%s\n", TEXT_COLOR_GRN, testname, TEXT_COLOR_RESET); \ fflush(stdout); \ } else { \ printf("\t%s%s FAILED!%s\n", TEXT_COLOR_RED, testname, TEXT_COLOR_RESET); \ - abort(); }\ + abort(); } } \ /** * @brief Display the name test */ -#define dap_pass_msg(testname) \ +#define dap_pass_msg(testname) { \ printf("\t%s%s PASS.%s\n", TEXT_COLOR_GRN, testname, TEXT_COLOR_RESET); \ - fflush(stdout); \ + fflush(stdout); } \ /** * @brief Display the name of the test module */ -#define dap_print_module_name(module_name) \ +#define dap_print_module_name(module_name) { \ printf("%s%s passing the tests... %s\n", TEXT_COLOR_CYN, module_name, TEXT_COLOR_RESET); \ - fflush(stdout); - - -#define dap_pass_msg(testname) \ - printf("\t%s%s PASS.%s\n", TEXT_COLOR_GRN, testname, TEXT_COLOR_RESET); \ - fflush(stdout); \ - + fflush(stdout); } +#define dap_str_equals(str1, str2) strcmp(str1, str2) == 0 /*