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

◆ FL_CHECK_STR_CONTAINS

#define FL_CHECK_STR_CONTAINS ( haystack,
needle )
Value:
do { \
fl::string _fl_haystack(haystack); \
fl::string _fl_needle(needle); \
bool _fl_result = (_fl_haystack.find(_fl_needle) != fl::string::npos); \
fl::test::AssertResult ar(_fl_result); \
ar.mLocation = fl::test::SourceLocation(__FILE__, __LINE__); \
fl::sstream _fl_ss; \
_fl_ss << #haystack << " contains " << #needle; \
ar.mExpression = _fl_ss.str(); \
if (!_fl_result) { \
fl::sstream _fl_ess; \
_fl_ess << "\"" << _fl_haystack << "\" does not contain \"" << _fl_needle << "\""; \
ar.mExpanded = _fl_ess.str(); \
} \
fl::test::TestContext::instance().reportAssert(ar); \
} while (0)
string str() const FL_NOEXCEPT
Definition strstream.h:43
static constexpr fl::size npos
Definition string.h:195

Definition at line 1197 of file fltest.h.

1197#define FL_CHECK_STR_CONTAINS(haystack, needle) \
1198 do { \
1199 fl::string _fl_haystack(haystack); \
1200 fl::string _fl_needle(needle); \
1201 bool _fl_result = (_fl_haystack.find(_fl_needle) != fl::string::npos); \
1202 fl::test::AssertResult ar(_fl_result); \
1203 ar.mLocation = fl::test::SourceLocation(__FILE__, __LINE__); \
1204 fl::sstream _fl_ss; \
1205 _fl_ss << #haystack << " contains " << #needle; \
1206 ar.mExpression = _fl_ss.str(); \
1207 if (!_fl_result) { \
1208 fl::sstream _fl_ess; \
1209 _fl_ess << "\"" << _fl_haystack << "\" does not contain \"" << _fl_needle << "\""; \
1210 ar.mExpanded = _fl_ess.str(); \
1211 } \
1212 fl::test::TestContext::instance().reportAssert(ar); \
1213 } while (0)