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,
double lhs,
93 const char* opName,
bool (*op)(
double lhs,
double rhs),
96 bool assertion(
const char* file, uint16_t line,
const char* lhs,
97 const char* opName,
bool (*op)(
const char* lhs,
const char* rhs),
100 bool assertion(
const char* file, uint16_t line,
const char* lhs,
101 const char* opName,
bool (*op)(
const char* lhs,
const String& rhs),
104 bool assertion(
const char* file, uint16_t line,
const char* lhs,
106 bool (*op)(
const char* lhs,
const __FlashStringHelper* rhs),
107 const __FlashStringHelper* rhs);
109 bool assertion(
const char* file, uint16_t line,
const String& lhs,
110 const char* opName,
bool (*op)(
const String& lhs,
const char* rhs),
113 bool assertion(
const char* file, uint16_t line,
const String& lhs,
114 const char* opName,
bool (*op)(
const String& lhs,
const String& rhs),
117 bool assertion(
const char* file, uint16_t line,
const String& lhs,
119 bool (*op)(
const String& lhs,
const __FlashStringHelper* rhs),
120 const __FlashStringHelper* rhs);
122 bool assertion(
const char* file, uint16_t line,
123 const __FlashStringHelper* lhs,
const char* opName,
124 bool (*op)(
const __FlashStringHelper* lhs,
const char* rhs),
127 bool assertion(
const char* file, uint16_t line,
128 const __FlashStringHelper* lhs,
const char* opName,
129 bool (*op)(
const __FlashStringHelper* lhs,
const String& rhs),
132 bool assertion(
const char* file, uint16_t line,
133 const __FlashStringHelper* lhs,
const char* opName,
134 bool (*op)(
const __FlashStringHelper* lhs,
135 const __FlashStringHelper* rhs),
136 const __FlashStringHelper* rhs);
138 bool assertionNear(
const char* file, uint16_t line,
139 int lhs,
int rhs,
int error,
const char* opName,
140 bool (*compareNear)(
int lhs,
int rhs,
int error));
142 bool assertionNear(
const char* file, uint16_t line,
143 unsigned int lhs,
unsigned int rhs,
unsigned int error,
146 unsigned int lhs,
unsigned int rhs,
unsigned int error));
148 bool assertionNear(
const char* file, uint16_t line,
149 long lhs,
long rhs,
long error,
const char* opName,
150 bool (*compareNear)(
long lhs,
long rhs,
long error));
152 bool assertionNear(
const char* file, uint16_t line,
153 unsigned long lhs,
unsigned long rhs,
unsigned long error,
156 unsigned long lhs,
unsigned long rhs,
unsigned long error));
158 bool assertionNear(
const char* file, uint16_t line,
159 double lhs,
double rhs,
double error,
const char* opName,
160 bool (*compareNear)(
double lhs,
double rhs,
double error));
164 bool assertionBoolVerbose(
const char* file, uint16_t line,
bool arg,
165 const __FlashStringHelper* argString,
bool value);
167 bool assertionVerbose(
const char* file, uint16_t line,
bool lhs,
168 const __FlashStringHelper* lhsString,
const char* opName,
169 bool (*op)(
bool lhs,
bool rhs),
170 bool rhs,
const __FlashStringHelper* rhsString);
172 bool assertionVerbose(
const char* file, uint16_t line,
char lhs,
173 const __FlashStringHelper* lhsString,
const char* opName,
174 bool (*op)(
char lhs,
char rhs),
175 char rhs,
const __FlashStringHelper* rhsString);
177 bool assertionVerbose(
const char* file, uint16_t line,
int lhs,
178 const __FlashStringHelper* lhsString,
const char* opName,
179 bool (*op)(
int lhs,
int rhs),
180 int rhs,
const __FlashStringHelper* rhsString);
182 bool assertionVerbose(
const char* file, uint16_t line,
unsigned int lhs,
183 const __FlashStringHelper* lhsString,
const char* opName,
184 bool (*op)(
unsigned int lhs,
unsigned int rhs),
185 unsigned int rhs,
const __FlashStringHelper* rhsString);
187 bool assertionVerbose(
const char* file, uint16_t line,
long lhs,
188 const __FlashStringHelper* lhsString,
const char* opName,
189 bool (*op)(
long lhs,
long rhs),
190 long rhs,
const __FlashStringHelper* rhsString);
192 bool assertionVerbose(
const char* file, uint16_t line,
unsigned long lhs,
193 const __FlashStringHelper* lhsString,
const char* opName,
194 bool (*op)(
unsigned long lhs,
unsigned long rhs),
195 unsigned long rhs,
const __FlashStringHelper* rhsString);
197 bool assertionVerbose(
const char* file, uint16_t line,
double lhs,
198 const __FlashStringHelper* lhsString,
const char* opName,
199 bool (*op)(
double lhs,
double rhs),
200 double rhs,
const __FlashStringHelper* rhsString);
202 bool assertionVerbose(
const char* file, uint16_t line,
const char* lhs,
203 const __FlashStringHelper* lhsString,
const char* opName,
204 bool (*op)(
const char* lhs,
const char* rhs),
205 const char* rhs,
const __FlashStringHelper* rhsString);
207 bool assertionVerbose(
const char* file, uint16_t line,
const char* lhs,
208 const __FlashStringHelper* lhsString,
const char* opName,
209 bool (*op)(
const char* lhs,
const String& rhs),
210 const String& rhs,
const __FlashStringHelper* rhsString);
212 bool assertionVerbose(
const char* file, uint16_t line,
const char* lhs,
213 const __FlashStringHelper* lhsString,
const char* opName,
214 bool (*op)(
const char* lhs,
const __FlashStringHelper* rhs),
215 const __FlashStringHelper* rhs,
const __FlashStringHelper* rhsString);
217 bool assertionVerbose(
const char* file, uint16_t line,
const String& lhs,
218 const __FlashStringHelper* lhsString,
const char* opName,
219 bool (*op)(
const String& lhs,
const char* rhs),
220 const char* rhs,
const __FlashStringHelper* rhsString);
222 bool assertionVerbose(
const char* file, uint16_t line,
const String& lhs,
223 const __FlashStringHelper* lhsString,
const char* opName,
224 bool (*op)(
const String& lhs,
const String& rhs),
225 const String& rhs,
const __FlashStringHelper* rhsString);
227 bool assertionVerbose(
const char* file, uint16_t line,
const String& lhs,
228 const __FlashStringHelper* lhsString,
const char* opName,
229 bool (*op)(
const String& lhs,
const __FlashStringHelper* rhs),
230 const __FlashStringHelper* rhs,
const __FlashStringHelper* rhsString);
232 bool assertionVerbose(
const char* file, uint16_t line,
233 const __FlashStringHelper* lhs,
const __FlashStringHelper* lhsString,
235 bool (*op)(
const __FlashStringHelper* lhs,
const char* rhs),
236 const char* rhs,
const __FlashStringHelper* rhsString);
238 bool assertionVerbose(
const char* file, uint16_t line,
239 const __FlashStringHelper* lhs,
const __FlashStringHelper* lhsString,
241 bool (*op)(
const __FlashStringHelper* lhs,
const String& rhs),
242 const String& rhs,
const __FlashStringHelper* rhsString);
244 bool assertionVerbose(
const char* file, uint16_t line,
245 const __FlashStringHelper* lhs,
const __FlashStringHelper* lhsString,
247 bool (*op)(
const __FlashStringHelper* lhs,
248 const __FlashStringHelper* rhs),
249 const __FlashStringHelper* rhs,
const __FlashStringHelper* rhsString);
251 bool assertionNearVerbose(
const char* file, uint16_t line,
252 int lhs,
const __FlashStringHelper* lhsString,
253 int rhs,
const __FlashStringHelper* rhsString,
254 int error,
const __FlashStringHelper* errorString,
256 bool (*compareNear)(
int lhs,
int rhs,
int error));
258 bool assertionNearVerbose(
const char* file, uint16_t line,
259 unsigned int lhs,
const __FlashStringHelper* lhsString,
260 unsigned int rhs,
const __FlashStringHelper* rhsString,
261 unsigned int error,
const __FlashStringHelper* errorString,
264 unsigned int lhs,
unsigned int rhs,
unsigned int error));
266 bool assertionNearVerbose(
const char* file, uint16_t line,
267 long lhs,
const __FlashStringHelper* lhsString,
268 long rhs,
const __FlashStringHelper* rhsString,
269 long error,
const __FlashStringHelper* errorString,
271 bool (*compareNear)(
long lhs,
long rhs,
long error));
273 bool assertionNearVerbose(
const char* file, uint16_t line,
274 unsigned long lhs,
const __FlashStringHelper* lhsString,
275 unsigned long rhs,
const __FlashStringHelper* rhsString,
276 unsigned long error,
const __FlashStringHelper* errorString,
279 unsigned long lhs,
unsigned long rhs,
unsigned long error));
281 bool assertionNearVerbose(
const char* file, uint16_t line,
282 double lhs,
const __FlashStringHelper* lhsString,
283 double rhs,
const __FlashStringHelper* rhsString,
284 double error,
const __FlashStringHelper* errorString,
286 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.