From 6d69cc4be2ccbc5fc978adadab4fbcc52bc31d36 Mon Sep 17 00:00:00 2001
From: armatusmiles <akurotych@gmail.com>
Date: Fri, 11 Jan 2019 21:44:54 +0700
Subject: [PATCH] [+] dap_str_equals

---
 dap_test.h | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/dap_test.h b/dap_test.h
index 8dd354f..929604f 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
 
 
 /*
-- 
GitLab