diff options
author | Kevin Pulo <kevin.pulo@mongodb.com> | 2019-05-08 07:13:13 +0000 |
---|---|---|
committer | Kevin Pulo <kevin.pulo@mongodb.com> | 2019-05-29 05:44:11 +0000 |
commit | b6b3e099b3ed0c7e43b133932e021106c59f2249 (patch) | |
tree | b209fb18813b70f09f6472c3a45a0a72b6dc8a7e /src/mongo/unittest | |
parent | 441714bc4c70699950f3ac51a5cac41dcd413eaa (diff) | |
download | mongo-b6b3e099b3ed0c7e43b133932e021106c59f2249.tar.gz |
SERVER-41047 errnoWithDescription only check __ANDROID_API__ if it's defined
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/unittest.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index 415a0e697fd..15be3f3587a 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -248,6 +248,18 @@ } \ } while (false) +#define ASSERT_STRING_OMITS(BIG_STRING, OMITS) \ + do { \ + std::string myString(BIG_STRING); \ + std::string myOmits(OMITS); \ + if (myString.find(myOmits) != std::string::npos) { \ + ::mongo::str::stream err; \ + err << "Did not expect to find " #OMITS " (" << myOmits << ") in " #BIG_STRING " (" \ + << myString << ")"; \ + ::mongo::unittest::TestAssertionFailure(__FILE__, __LINE__, err).stream(); \ + } \ + } while (false) + /** * Construct a single test, named "TEST_NAME" within the test case "CASE_NAME". * |