Bug 1317451 - ASSERT_DEATH replaced by ASSERT_DEATH_IF_SUPPORTED. r?froydnj
MozReview-Commit-ID: Auqwd0NlM17
--- a/xpcom/tests/gtest/TestDeadlockDetector.cpp
+++ b/xpcom/tests/gtest/TestDeadlockDetector.cpp
@@ -90,17 +90,17 @@ TEST_F(DeadlockDetectorTest, SanityDeath
{
const char* const regex =
"###!!! ERROR: Potential deadlock detected.*"
"=== Cyclical dependency starts at.*--- Mutex : dd.sanity.m1.*"
"=== Cycle completed at.*--- Mutex : dd.sanity.m1.*"
"###!!! Deadlock may happen NOW!.*" // better catch these easy cases...
"###!!! ASSERTION: Potential deadlock detected.*";
- ASSERT_DEATH(Sanity_Child(), regex);
+ ASSERT_DEATH_IF_SUPPORTED(Sanity_Child(), regex);
}
// Slightly less stupid deadlock.
int
Sanity2_Child()
{
DisableCrashReporter();
@@ -117,17 +117,17 @@ TEST_F(DeadlockDetectorTest, Sanity2Deat
const char* const regex =
"###!!! ERROR: Potential deadlock detected.*"
"=== Cyclical dependency starts at.*--- Mutex : dd.sanity2.m1.*"
"--- Next dependency:.*--- Mutex : dd.sanity2.m2.*"
"=== Cycle completed at.*--- Mutex : dd.sanity2.m1.*"
"###!!! Deadlock may happen NOW!.*" // better catch these easy cases...
"###!!! ASSERTION: Potential deadlock detected.*";
- ASSERT_DEATH(Sanity2_Child(), regex);
+ ASSERT_DEATH_IF_SUPPORTED(Sanity2_Child(), regex);
}
int
Sanity3_Child()
{
DisableCrashReporter();
mozilla::Mutex m1("dd.sanity3.m1");
@@ -155,17 +155,17 @@ TEST_F(DeadlockDetectorTest, Sanity3Deat
"###!!! ERROR: Potential deadlock detected.*"
"=== Cyclical dependency starts at.*--- Mutex : dd.sanity3.m1.*"
"--- Next dependency:.*--- Mutex : dd.sanity3.m2.*"
"--- Next dependency:.*--- Mutex : dd.sanity3.m3.*"
"--- Next dependency:.*--- Mutex : dd.sanity3.m4.*"
"=== Cycle completed at.*--- Mutex : dd.sanity3.m1.*"
"###!!! ASSERTION: Potential deadlock detected.*";
- ASSERT_DEATH(Sanity3_Child(), regex);
+ ASSERT_DEATH_IF_SUPPORTED(Sanity3_Child(), regex);
}
int
Sanity4_Child()
{
DisableCrashReporter();
mozilla::ReentrantMonitor m1("dd.sanity4.m1");
@@ -180,17 +180,17 @@ TEST_F(DeadlockDetectorTest, Sanity4Deat
{
const char* const regex =
"Re-entering ReentrantMonitor after acquiring other resources.*"
"###!!! ERROR: Potential deadlock detected.*"
"=== Cyclical dependency starts at.*--- ReentrantMonitor : dd.sanity4.m1.*"
"--- Next dependency:.*--- Mutex : dd.sanity4.m2.*"
"=== Cycle completed at.*--- ReentrantMonitor : dd.sanity4.m1.*"
"###!!! ASSERTION: Potential deadlock detected.*";
- ASSERT_DEATH(Sanity4_Child(), regex);
+ ASSERT_DEATH_IF_SUPPORTED(Sanity4_Child(), regex);
}
//-----------------------------------------------------------------------------
// Multithreaded tests
/**
* Helper for passing state to threads in the multithread tests.
*/
@@ -259,17 +259,17 @@ TEST_F(DeadlockDetectorTest, TwoThreadsD
{
const char* const regex =
"###!!! ERROR: Potential deadlock detected.*"
"=== Cyclical dependency starts at.*--- Mutex : dd.twothreads.m2.*"
"--- Next dependency:.*--- Mutex : dd.twothreads.m1.*"
"=== Cycle completed at.*--- Mutex : dd.twothreads.m2.*"
"###!!! ASSERTION: Potential deadlock detected.*";
- ASSERT_DEATH(TwoThreads_Child(), regex);
+ ASSERT_DEATH_IF_SUPPORTED(TwoThreads_Child(), regex);
}
static void
ContentionNoDeadlock_thread(void* arg)
{
const uint32_t K = 100000;
ThreadState* state = static_cast<ThreadState*>(arg);
--- a/xpcom/tests/gtest/TestSTLWrappers.cpp
+++ b/xpcom/tests/gtest/TestSTLWrappers.cpp
@@ -69,10 +69,10 @@ void ShouldAbort()
}
#ifdef XP_WIN
TEST(STLWrapper, DISABLED_ShouldAbortDeathTest)
#else
TEST(STLWrapper, ShouldAbortDeathTest)
#endif
{
- ASSERT_DEATH(ShouldAbort(), "terminate called after throwing an instance of 'std::out_of_range'|vector::_M_range_check");
+ ASSERT_DEATH_IF_SUPPORTED(ShouldAbort(), "terminate called after throwing an instance of 'std::out_of_range'|vector::_M_range_check");
}