@@ -90,49 +90,50 @@ typedef struct
90
90
#define UtAssert_True (Expression , ...) UtAssertEx(Expression, UtAssert_GetContext(), __FILE__, __LINE__, __VA_ARGS__)
91
91
92
92
/* Evaluates a expression as either true or false. true means the test passed, false means the test failed. */
93
- #define UtAssert_Bool (Expression , Description ) UtAssert(Expression, Description, __FILE__, __LINE__)
93
+ #define UtAssert_Bool (Expression , ...) \
94
+ UtAssertEx(Expression, UtAssert_GetContext(), __FILE__, __LINE__, __VA_ARGS__)
94
95
95
96
/* Asserts a test failure */
96
97
#define UtAssert_Failed (...) UtAssertEx(false, UtAssert_GetContext(), __FILE__, __LINE__, __VA_ARGS__)
97
98
98
99
/* Compares two integers and determines if they are equal within a specified absolute tolerance. */
99
- #define UtAssert_IntegerCmpAbs (x , y , Tolerance , Description ) \
100
- UtAssert ((abs((x) - (y)) <= (Tolerance)), Description , __FILE__, __LINE__)
100
+ #define UtAssert_IntegerCmpAbs (x , y , Tolerance , ... ) \
101
+ UtAssertEx ((abs((x) - (y)) <= (Tolerance)), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
101
102
102
103
/* Compares two floating point numbers and determines if they are equal within a specified absolute tolerance. */
103
- #define UtAssert_DoubleCmpAbs (x , y , Tolerance , Description ) \
104
- UtAssert ((fabs((x) - (y)) <= (Tolerance)), Description , __FILE__, __LINE__)
104
+ #define UtAssert_DoubleCmpAbs (x , y , Tolerance , ... ) \
105
+ UtAssertEx ((fabs((x) - (y)) <= (Tolerance)), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
105
106
106
107
/* Compares two floating point numbers and determines if they are equal within a specified relative tolerance. */
107
- #define UtAssert_DoubleCmpRel (x , y , Ratio , Description ) \
108
- UtAssert ((fabs((x) - (y)) / (x) <= (Ratio)), Description , __FILE__, __LINE__)
108
+ #define UtAssert_DoubleCmpRel (x , y , Ratio , ... ) \
109
+ UtAssertEx ((fabs((x) - (y))/ (x) <= (Ratio)), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
109
110
110
111
/* Compares two strings and determines if they are equal. */
111
- #define UtAssert_StrCmp (String1 , String2 , Description ) \
112
- UtAssert ((strcmp(String1, String2) == 0), Description , __FILE__, __LINE__)
112
+ #define UtAssert_StrCmp (String1 , String2 , ... ) \
113
+ UtAssertEx ((strcmp(String1, String2) == 0), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
113
114
114
115
/* Compares at most Length characters of two strings and determines if they are equal. */
115
- #define UtAssert_StrnCmp (String1 , String2 , Length , Description ) \
116
- UtAssert ((strncmp(String1, String2, Length) == 0), Description , __FILE__, __LINE__)
116
+ #define UtAssert_StrnCmp (String1 , String2 , Length , ... ) \
117
+ UtAssertEx ((strncmp(String1, String2, Length) == 0), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
117
118
118
119
/* Compares two regions of memory and determines if they are equal. */
119
- #define UtAssert_MemCmp (Memory1 , Memory2 , Length , Description ) \
120
- UtAssert ((memcmp(Memory1, Memory2, Length) == 0), Description , __FILE__, __LINE__)
120
+ #define UtAssert_MemCmp (Memory1 , Memory2 , Length , ... ) \
121
+ UtAssertEx ((memcmp(Memory1, Memory2, Length) == 0), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
121
122
122
123
/* Compares a region of memory to a static pattern and determines if they are equal. Note: Use UtMemSet to
123
124
* fill a region of memory with a static pattern. */
124
- #define UtAssert_MemCmpValue (Memory , Value , Length , Description ) \
125
- UtAssert ((UtMemCmpValue(Memory, Value, Length)), Description , __FILE__, __LINE__)
125
+ #define UtAssert_MemCmpValue (Memory , Value , Length , ... ) \
126
+ UtAssertEx ((UtMemCmpValue(Memory, Value, Length)), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
126
127
127
128
/* Compares a region of memory to a byte count pattern and determines if they are equal. Note: Use UtMemFill to
128
129
* fill a region of memory with a byte count pattern. */
129
- #define UtAssert_MemCmpCount (Memory , Length , Description ) \
130
- UtAssert ((UtMemCmpCount(Memory, Length)), Description , __FILE__, __LINE__)
130
+ #define UtAssert_MemCmpCount (Memory , Length , ... ) \
131
+ UtAssertEx ((UtMemCmpCount(Memory, Length)), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
131
132
132
133
/* Compares a region of memory with the contents of a binary file and determines if they are equal. Note: Use
133
134
* UtMem2BinFile to copy a region of memory to a binary file. */
134
- #define UtAssert_Mem2BinFileCmp (Memory , Filename , Description ) \
135
- UtAssert ((UtMem2BinFileCmp(Memory, Filename)), Description , __FILE__, __LINE__)
135
+ #define UtAssert_Mem2BinFileCmp (Memory , Filename , ... ) \
136
+ UtAssertEx ((UtMem2BinFileCmp(Memory, Filename)), UtAssert_GetContext() , __FILE__, __LINE__, __VA_ARGS__ )
136
137
137
138
/* A wrapper around UtAssertEx that allows the user to specify the failure type and a more descriptive message */
138
139
#define UtAssert_Type (Type , Expression , ...) \
0 commit comments