From 3b3fa008590ee48a7490e5c71dd39ff5417c5f79 Mon Sep 17 00:00:00 2001 From: Peter Griess Date: Thu, 26 Sep 2013 13:43:15 -0500 Subject: [PATCH] Change ScopeGuardTest to work around libc++'s different terminate() semantics. Summary: - Looks like the default terminate() in libc++ doesn't reflect the exception message to stderr. Instead, it just writes a generic message. Reflect that in the test. Test Plan: - fbconfig -r folly && fbmake runtests - ./configure && make check on Ubuntu/FC/Mac Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D998590 --- folly/test/ScopeGuardTest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/folly/test/ScopeGuardTest.cpp b/folly/test/ScopeGuardTest.cpp index 35b1e3a9..6e6b65a8 100644 --- a/folly/test/ScopeGuardTest.cpp +++ b/folly/test/ScopeGuardTest.cpp @@ -126,7 +126,12 @@ TEST(ScopeGuard, GuardException) { throw std::runtime_error("destructors should never throw!"); }); }, - "destructors should never throw"); +#ifdef _LIBCPP_VERSION + "terminate called throwing an exception" +#else + "destructors should never throw" +#endif + ); } /** -- 2.34.1