Change ScopeGuardTest to work around libc++'s different terminate() semantics.
authorPeter Griess <pgriess@fb.com>
Thu, 26 Sep 2013 18:43:15 +0000 (13:43 -0500)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:46:33 +0000 (18:46 -0700)
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

index 35b1e3a905e8328f86b75935b8a947dadd6d1752..6e6b65a8acea0aa24962065e209f164d56371c4a 100644 (file)
@@ -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
+  );
 }
 
 /**