summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-02-15 01:14:04 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-15 12:39:25 +0000
commitda28fac8ae4d26a582000151ec1d24604f9a8fb3 (patch)
tree67e0ad2c55464ba424d533757d6f39994015aa19
parent611979eb5cafba7bb5369a19948f82453f117c65 (diff)
downloadmongo-da28fac8ae4d26a582000151ec1d24604f9a8fb3.tar.gz
SERVER-46102 fix test to work under mac os x
This test restores the subset comparison behavior, for mac os x only, that was changed to a set equality check in commit 94605304208b2d20716ecc09c543e65708751516.
-rw-r--r--src/mongo/util/stacktrace_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/util/stacktrace_test.cpp b/src/mongo/util/stacktrace_test.cpp
index 597e4d08f24..7fb200382a2 100644
--- a/src/mongo/util/stacktrace_test.cpp
+++ b/src/mongo/util/stacktrace_test.cpp
@@ -225,7 +225,15 @@ TEST(StackTrace, PosixFormat) {
for (const auto& btElem : jsonObj["backtrace"].embeddedObject()) {
btAddrs.push_back(fromHex(btElem.embeddedObject()["a"].String()));
}
+
+ // Mac OS backtrace returns extra frames in "backtrace".
+#if defined(__APPLE__)
+ ASSERT_TRUE(std::search(btAddrs.begin(), btAddrs.end(), humanAddrs.begin(), humanAddrs.end()) ==
+ btAddrs.begin())
+ << LogVec(btAddrs) << " vs " << LogVec(humanAddrs);
+#else
ASSERT_TRUE(btAddrs == humanAddrs) << LogVec(btAddrs) << " vs " << LogVec(humanAddrs);
+#endif // __APPLE
}
TEST(StackTrace, WindowsFormat) {