FastLED 3.9.15
Loading...
Searching...
No Matches

◆ FL_CHECK_ARRAY_EQ

#define FL_CHECK_ARRAY_EQ ( actual,
expected,
arrsize )
Value:
do { \
bool _fl_arr_match = true; \
fl::size _fl_arr_mismatch_idx = 0; \
{ \
fl::size _fl_arr_i = 0; \
fl::size _fl_arr_sz = static_cast<fl::size>(arrsize); \
while (_fl_arr_i < _fl_arr_sz) { \
if (!((actual)[_fl_arr_i] == (expected)[_fl_arr_i])) { \
_fl_arr_match = false; \
_fl_arr_mismatch_idx = _fl_arr_i; \
break; \
} \
++_fl_arr_i; \
} \
} \
fl::test::AssertResult _fl_arr_ar(_fl_arr_match); \
_fl_arr_ar.mLocation = fl::test::SourceLocation(__FILE__, __LINE__); \
fl::sstream _fl_arr_ss; \
_fl_arr_ss << #actual << " == " << #expected << " (size=" << (arrsize) << ")"; \
_fl_arr_ar.mExpression = _fl_arr_ss.str(); \
if (!_fl_arr_match) { \
fl::sstream _fl_arr_ess; \
_fl_arr_ess << "Mismatch at index " << _fl_arr_mismatch_idx \
<< ": " << (actual)[_fl_arr_mismatch_idx] \
<< " != " << (expected)[_fl_arr_mismatch_idx]; \
_fl_arr_ar.mExpanded = _fl_arr_ess.str(); \
} \
fl::test::TestContext::instance().reportAssert(_fl_arr_ar); \
} while (0)
string str() const FL_NOEXCEPT
Definition strstream.h:43

Definition at line 1263 of file fltest.h.

1263#define FL_CHECK_ARRAY_EQ(actual, expected, arrsize) \
1264 do { \
1265 bool _fl_arr_match = true; \
1266 fl::size _fl_arr_mismatch_idx = 0; \
1267 { \
1268 fl::size _fl_arr_i = 0; \
1269 fl::size _fl_arr_sz = static_cast<fl::size>(arrsize); \
1270 while (_fl_arr_i < _fl_arr_sz) { \
1271 if (!((actual)[_fl_arr_i] == (expected)[_fl_arr_i])) { \
1272 _fl_arr_match = false; \
1273 _fl_arr_mismatch_idx = _fl_arr_i; \
1274 break; \
1275 } \
1276 ++_fl_arr_i; \
1277 } \
1278 } \
1279 fl::test::AssertResult _fl_arr_ar(_fl_arr_match); \
1280 _fl_arr_ar.mLocation = fl::test::SourceLocation(__FILE__, __LINE__); \
1281 fl::sstream _fl_arr_ss; \
1282 _fl_arr_ss << #actual << " == " << #expected << " (size=" << (arrsize) << ")"; \
1283 _fl_arr_ar.mExpression = _fl_arr_ss.str(); \
1284 if (!_fl_arr_match) { \
1285 fl::sstream _fl_arr_ess; \
1286 _fl_arr_ess << "Mismatch at index " << _fl_arr_mismatch_idx \
1287 << ": " << (actual)[_fl_arr_mismatch_idx] \
1288 << " != " << (expected)[_fl_arr_mismatch_idx]; \
1289 _fl_arr_ar.mExpanded = _fl_arr_ess.str(); \
1290 } \
1291 fl::test::TestContext::instance().reportAssert(_fl_arr_ar); \
1292 } while (0)