#define TC_ASSERT_EQ_CLEANUP(api_name, var, ref, error, freeResource) \
{\
- if (var != ref) {\
+ if ((var) != (ref)) {\
printf("\n[%s][Line : %d] FAIL, %s : API error returned = %s [%d] ", __func__, __LINE__, api_name, error, #var); \
total_fail++; \
freeResource; \
#define TC_ASSERT_EQ(api_name, var, ref) \
{\
- if (var != ref) {\
- printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", __func__, __LINE__, api_name, #var, (int)var, #ref, (int)ref); \
+ if ((var) != (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) and (%s == 0x%x) are not equal\n", __func__, __LINE__, api_name, #var, (int)(var), #ref, (int)(ref)); \
total_fail++; \
} \
}
#define TC_ASSERT_NEQ_CLEANUP(api_name, var, ref, error, freeResource) \
{\
- if (var == ref) {\
+ if ((var) == (ref)) {\
printf("\n[%s][Line : %d] FAIL, %s : API error returned = %s [%d] ", __func__, __LINE__, api_name, error, #var); \
total_fail++; \
freeResource; \
#define TC_ASSERT_NEQ(api_name, var, ref) \
{\
- if (var == ref) {\
- printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) and (%s == 0x%x) are equal\n", __func__, __LINE__, api_name, #var, (int)var, #ref, (int)ref); \
+ if ((var) == (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) and (%s == 0x%x) are equal\n", __func__, __LINE__, api_name, #var, (int)(var), #ref, (int)(ref)); \
total_fail++; \
return; \
} \
#define TC_ASSERT_GT_CLEANUP(api_name, var, ref, error, freeResource) \
{\
- if (var <= ref) {\
+ if ((var) <= (ref)) {\
printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not greater than (%s == 0x%x)\n", __func__, __LINE__, api_name, error, #var); \
total_fail++; \
freeResource; \
#define TC_ASSERT_GT(api_name, var, ref) \
{\
- if (var <= ref) {\
- printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not greater than (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)var, #ref, (int)ref); \
+ if ((var) <= (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not greater than (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)(var), #ref, (int)(ref)); \
total_fail++; \
return; \
} \
#define TC_ASSERT_GEQ_CLEANUP(api_name, var, ref, error, freeResource) \
{\
- if (var < ref) {\
+ if ((var) < (ref)) {\
printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not greater than or euqal to (%s == 0x%x)\n", __func__, __LINE__, api_name, error, #var); \
total_fail++; \
freeResource; \
#define TC_ASSERT_GEQ(api_name, var, ref) \
{\
- if (var < ref) {\
- printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not greater than or equal to (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)var, #ref, (int)ref); \
+ if ((var) < (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not greater than or equal to (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)(var), #ref, (int)(ref)); \
total_fail++; \
return; \
} \
#define TC_ASSERT_LT(api_name, var, ref) \
{\
- if (var >= ref) {\
- printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not lower than (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)var, #ref, (int)ref); \
+ if ((var) >= (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not lower than (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)(var), #ref, (int)(ref)); \
total_fail++; \
return; \
} \
#define TC_ASSERT_LEQ(api_name, var, ref) \
{\
- if (var > ref) {\
- printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)var, #ref, (int)ref); \
+ if ((var) > (ref)) {\
+ printf("\n[%s][Line : %d] FAIL, %s : Values (%s == 0x%x) is not lower than or equal to (%s == 0x%x)\n", __func__, __LINE__, api_name, #var, (int)(var), #ref, (int)(ref)); \
total_fail++; \
return; \
} \
#define TC_ASSERT_NOT_NULL(api_name, handle) \
{\
- if (handle == NULL) {\
+ if ((handle) == NULL) {\
printf("\n[%s][Line : %d] FAIL , %s : API returned NULL ", __func__, __LINE__, api_name); \
total_fail++; \
return; \
#define TC_FREE_MEMORY(buffer) \
{\
- if (buffer != NULL) {\
+ if ((buffer) != NULL) {\
free(buffer); \
buffer = NULL; \
} \