Add tc macros, TC_ASSERT_LT_CLEANUP and TC_ASSERT_LEQ_CLEANUP
@@ -119,6 +119,16 @@ int total_fail;
} \
}
+#define TC_ASSERT_LT_CLEANUP(api_name, var, ref, error, freeResource) \
+{\
+ if ((var) >= (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : API error returned = %s, (%s == 0x%x) is not lower than (%s == 0x%x)\n", __func__, __LINE__, api_name, error, #var, (int)(var), #ref, (int)(ref)); \
+ total_fail++; \
+ freeResource; \
+ return; \
+ } \
+}
+
#define TC_ASSERT_LT(api_name, var, ref) \
{\
if ((var) >= (ref)) {\
@@ -128,6 +138,16 @@ int total_fail;
} \
}
+#define TC_ASSERT_LEQ_CLEANUP(api_name, var, ref, error, freeResource) \
+{\
+ if ((var) > (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : API error returned = %s, (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\n", __func__, __LINE__, api_name, error, #var, (int)(var), #ref, (int)(ref)); \
+ total_fail++; \
+ freeResource; \
+ return; \
+ } \
+}
+
#define TC_ASSERT_LEQ(api_name, var, ref) \
{\
if ((var) > (ref)) {\
