Bug 1317451 - ASSERT_DEATH replaced by ASSERT_DEATH_IF_SUPPORTED. r?froydnj draft
authorMichelangelo De Simone <mdesimone@mozilla.com>
Sun, 13 Nov 2016 11:12:49 -0800
changeset 438607 694e88d565bbcdb3505056a2570bc493f62a53e7
parent 438550 71fd23fa0803a548b6e571aa25d0533a06cd0421
child 438610 99538c3dde1d2905cfb6f5a338bc65dfdb40fcec
child 438612 28bf5cf4954b7727b994a9f09de6a9be7859d060
push id35779
push usermdesimone@mozilla.com
push dateMon, 14 Nov 2016 21:25:54 +0000
reviewersfroydnj
bugs1317451
milestone53.0a1
Bug 1317451 - ASSERT_DEATH replaced by ASSERT_DEATH_IF_SUPPORTED. r?froydnj MozReview-Commit-ID: Auqwd0NlM17
xpcom/tests/gtest/TestDeadlockDetector.cpp
xpcom/tests/gtest/TestSTLWrappers.cpp
--- 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");
 }