25 #ifndef AUNIT_ASSERTION_H 26 #define AUNIT_ASSERTION_H 31 class __FlashStringHelper;
65 bool assertionBool(
const char* file, uint16_t line,
bool arg,
68 bool assertion(
const char* file, uint16_t line,
bool lhs,
69 const char* opName,
bool (*op)(
bool lhs,
bool rhs),
72 bool assertion(
const char* file, uint16_t line,
char lhs,
73 const char* opName,
bool (*op)(
char lhs,
char rhs),
76 bool assertion(
const char* file, uint16_t line,
int lhs,
77 const char* opName,
bool (*op)(
int lhs,
int rhs),
80 bool assertion(
const char* file, uint16_t line,
unsigned int lhs,
81 const char* opName,
bool (*op)(
unsigned int lhs,
unsigned int rhs),
84 bool assertion(
const char* file, uint16_t line,
long lhs,
85 const char* opName,
bool (*op)(
long lhs,
long rhs),
88 bool assertion(
const char* file, uint16_t line,
unsigned long lhs,
89 const char* opName,
bool (*op)(
unsigned long lhs,
unsigned long rhs),
92 bool assertion(
const char* file, uint16_t line,
long long lhs,
93 const char* opName,
bool (*op)(
long long lhs,
long long rhs),
96 bool assertion(
const char* file, uint16_t line,
unsigned long long lhs,
98 bool (*op)(
unsigned long long lhs,
unsigned long long rhs),
99 unsigned long long rhs);
101 bool assertion(
const char* file, uint16_t line,
double lhs,
102 const char* opName,
bool (*op)(
double lhs,
double rhs),
105 bool assertion(
const char* file, uint16_t line,
const char* lhs,
106 const char* opName,
bool (*op)(
const char* lhs,
const char* rhs),
109 bool assertion(
const char* file, uint16_t line,
const char* lhs,
110 const char* opName,
bool (*op)(
const char* lhs,
const String& rhs),
113 bool assertion(
const char* file, uint16_t line,
const char* lhs,
115 bool (*op)(
const char* lhs,
const __FlashStringHelper* rhs),
116 const __FlashStringHelper* rhs);
118 bool assertion(
const char* file, uint16_t line,
const String& lhs,
119 const char* opName,
bool (*op)(
const String& lhs,
const char* rhs),
122 bool assertion(
const char* file, uint16_t line,
const String& lhs,
123 const char* opName,
bool (*op)(
const String& lhs,
const String& rhs),
126 bool assertion(
const char* file, uint16_t line,
const String& lhs,
128 bool (*op)(
const String& lhs,
const __FlashStringHelper* rhs),
129 const __FlashStringHelper* rhs);
131 bool assertion(
const char* file, uint16_t line,
132 const __FlashStringHelper* lhs,
const char* opName,
133 bool (*op)(
const __FlashStringHelper* lhs,
const char* rhs),
136 bool assertion(
const char* file, uint16_t line,
137 const __FlashStringHelper* lhs,
const char* opName,
138 bool (*op)(
const __FlashStringHelper* lhs,
const String& rhs),
141 bool assertion(
const char* file, uint16_t line,
142 const __FlashStringHelper* lhs,
const char* opName,
143 bool (*op)(
const __FlashStringHelper* lhs,
144 const __FlashStringHelper* rhs),
145 const __FlashStringHelper* rhs);
147 bool assertionNear(
const char* file, uint16_t line,
148 int lhs,
int rhs,
int error,
const char* opName,
149 bool (*compareNear)(
int lhs,
int rhs,
int error));
151 bool assertionNear(
const char* file, uint16_t line,
152 unsigned int lhs,
unsigned int rhs,
unsigned int error,
155 unsigned int lhs,
unsigned int rhs,
unsigned int error));
157 bool assertionNear(
const char* file, uint16_t line,
158 long lhs,
long rhs,
long error,
const char* opName,
159 bool (*compareNear)(
long lhs,
long rhs,
long error));
161 bool assertionNear(
const char* file, uint16_t line,
162 unsigned long lhs,
unsigned long rhs,
unsigned long error,
165 unsigned long lhs,
unsigned long rhs,
unsigned long error));
167 bool assertionNear(
const char* file, uint16_t line,
168 double lhs,
double rhs,
double error,
const char* opName,
169 bool (*compareNear)(
double lhs,
double rhs,
double error));
173 bool assertionBoolVerbose(
const char* file, uint16_t line,
bool arg,
174 const __FlashStringHelper* argString,
bool value);
176 bool assertionVerbose(
const char* file, uint16_t line,
bool lhs,
177 const __FlashStringHelper* lhsString,
const char* opName,
178 bool (*op)(
bool lhs,
bool rhs),
179 bool rhs,
const __FlashStringHelper* rhsString);
181 bool assertionVerbose(
const char* file, uint16_t line,
char lhs,
182 const __FlashStringHelper* lhsString,
const char* opName,
183 bool (*op)(
char lhs,
char rhs),
184 char rhs,
const __FlashStringHelper* rhsString);
186 bool assertionVerbose(
const char* file, uint16_t line,
int lhs,
187 const __FlashStringHelper* lhsString,
const char* opName,
188 bool (*op)(
int lhs,
int rhs),
189 int rhs,
const __FlashStringHelper* rhsString);
191 bool assertionVerbose(
const char* file, uint16_t line,
unsigned int lhs,
192 const __FlashStringHelper* lhsString,
const char* opName,
193 bool (*op)(
unsigned int lhs,
unsigned int rhs),
194 unsigned int rhs,
const __FlashStringHelper* rhsString);
196 bool assertionVerbose(
const char* file, uint16_t line,
long lhs,
197 const __FlashStringHelper* lhsString,
const char* opName,
198 bool (*op)(
long lhs,
long rhs),
199 long rhs,
const __FlashStringHelper* rhsString);
201 bool assertionVerbose(
const char* file, uint16_t line,
unsigned long lhs,
202 const __FlashStringHelper* lhsString,
const char* opName,
203 bool (*op)(
unsigned long lhs,
unsigned long rhs),
204 unsigned long rhs,
const __FlashStringHelper* rhsString);
206 bool assertionVerbose(
const char* file, uint16_t line,
long long lhs,
207 const __FlashStringHelper* lhsString,
const char* opName,
208 bool (*op)(
long long lhs,
long long rhs),
209 long long rhs,
const __FlashStringHelper* rhsString);
211 bool assertionVerbose(
const char* file, uint16_t line,
212 unsigned long long lhs,
213 const __FlashStringHelper* lhsString,
const char* opName,
214 bool (*op)(
unsigned long long lhs,
unsigned long long rhs),
215 unsigned long long rhs,
const __FlashStringHelper* rhsString);
217 bool assertionVerbose(
const char* file, uint16_t line,
double lhs,
218 const __FlashStringHelper* lhsString,
const char* opName,
219 bool (*op)(
double lhs,
double rhs),
220 double rhs,
const __FlashStringHelper* rhsString);
222 bool assertionVerbose(
const char* file, uint16_t line,
const char* lhs,
223 const __FlashStringHelper* lhsString,
const char* opName,
224 bool (*op)(
const char* lhs,
const char* rhs),
225 const char* rhs,
const __FlashStringHelper* rhsString);
227 bool assertionVerbose(
const char* file, uint16_t line,
const char* lhs,
228 const __FlashStringHelper* lhsString,
const char* opName,
229 bool (*op)(
const char* lhs,
const String& rhs),
230 const String& rhs,
const __FlashStringHelper* rhsString);
232 bool assertionVerbose(
const char* file, uint16_t line,
const char* lhs,
233 const __FlashStringHelper* lhsString,
const char* opName,
234 bool (*op)(
const char* lhs,
const __FlashStringHelper* rhs),
235 const __FlashStringHelper* rhs,
const __FlashStringHelper* rhsString);
237 bool assertionVerbose(
const char* file, uint16_t line,
const String& lhs,
238 const __FlashStringHelper* lhsString,
const char* opName,
239 bool (*op)(
const String& lhs,
const char* rhs),
240 const char* rhs,
const __FlashStringHelper* rhsString);
242 bool assertionVerbose(
const char* file, uint16_t line,
const String& lhs,
243 const __FlashStringHelper* lhsString,
const char* opName,
244 bool (*op)(
const String& lhs,
const String& rhs),
245 const String& rhs,
const __FlashStringHelper* rhsString);
247 bool assertionVerbose(
const char* file, uint16_t line,
const String& lhs,
248 const __FlashStringHelper* lhsString,
const char* opName,
249 bool (*op)(
const String& lhs,
const __FlashStringHelper* rhs),
250 const __FlashStringHelper* rhs,
const __FlashStringHelper* rhsString);
252 bool assertionVerbose(
const char* file, uint16_t line,
253 const __FlashStringHelper* lhs,
const __FlashStringHelper* lhsString,
255 bool (*op)(
const __FlashStringHelper* lhs,
const char* rhs),
256 const char* rhs,
const __FlashStringHelper* rhsString);
258 bool assertionVerbose(
const char* file, uint16_t line,
259 const __FlashStringHelper* lhs,
const __FlashStringHelper* lhsString,
261 bool (*op)(
const __FlashStringHelper* lhs,
const String& rhs),
262 const String& rhs,
const __FlashStringHelper* rhsString);
264 bool assertionVerbose(
const char* file, uint16_t line,
265 const __FlashStringHelper* lhs,
const __FlashStringHelper* lhsString,
267 bool (*op)(
const __FlashStringHelper* lhs,
268 const __FlashStringHelper* rhs),
269 const __FlashStringHelper* rhs,
const __FlashStringHelper* rhsString);
271 bool assertionNearVerbose(
const char* file, uint16_t line,
272 int lhs,
const __FlashStringHelper* lhsString,
273 int rhs,
const __FlashStringHelper* rhsString,
274 int error,
const __FlashStringHelper* errorString,
276 bool (*compareNear)(
int lhs,
int rhs,
int error));
278 bool assertionNearVerbose(
const char* file, uint16_t line,
279 unsigned int lhs,
const __FlashStringHelper* lhsString,
280 unsigned int rhs,
const __FlashStringHelper* rhsString,
281 unsigned int error,
const __FlashStringHelper* errorString,
284 unsigned int lhs,
unsigned int rhs,
unsigned int error));
286 bool assertionNearVerbose(
const char* file, uint16_t line,
287 long lhs,
const __FlashStringHelper* lhsString,
288 long rhs,
const __FlashStringHelper* rhsString,
289 long error,
const __FlashStringHelper* errorString,
291 bool (*compareNear)(
long lhs,
long rhs,
long error));
293 bool assertionNearVerbose(
const char* file, uint16_t line,
294 unsigned long lhs,
const __FlashStringHelper* lhsString,
295 unsigned long rhs,
const __FlashStringHelper* rhsString,
296 unsigned long error,
const __FlashStringHelper* errorString,
299 unsigned long lhs,
unsigned long rhs,
unsigned long error));
301 bool assertionNearVerbose(
const char* file, uint16_t line,
302 double lhs,
const __FlashStringHelper* lhsString,
303 double rhs,
const __FlashStringHelper* rhsString,
304 double error,
const __FlashStringHelper* errorString,
306 bool (*compareNear)(
double lhs,
double rhs,
double error));
Base class of all test cases.
bool isOutputEnabled(bool ok)
Returns true if an assertion message should be printed.
An Assertion class is a subclass of Test and provides various overloaded assertion() functions...
Various macros to smooth over the differences among the various platforms with regards to their suppo...
Assertion()
Empty constructor.