Browse Source

[2332] use EXPECT_DEATH_IF_SUPPORTED instead of ifdef.

avoiding ifdef is generally better, and _IF_SUPPORTED seems to have been
supported since googletest 1.4 and should be commonly available for us.
JINMEI Tatuya 12 years ago
parent
commit
d504c06cbe
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/lib/util/threads/tests/condvar_unittest.cc

+ 1 - 3
src/lib/util/threads/tests/condvar_unittest.cc

@@ -137,18 +137,16 @@ signalAndWait(CondVar* condvar, Mutex* mutex) {
     condvar->wait(*mutex);
 }
 
-#ifdef EXPECT_DEATH
 TEST_F(CondVarTest, bad) {
     // We'll destroy a CondVar object while the thread is still waiting
     // on it.  This will trigger an assertion failure.
-    EXPECT_DEATH({
+    EXPECT_DEATH_IF_SUPPORTED({
             CondVar cond;
             Mutex::Locker locker(mutex_);
             Thread t(boost::bind(&signalAndWait, &cond, &mutex_));
             cond.wait(mutex_);
         }, "");
 }
-#endif
 
 TEST_F(CondVarTest, badWait) {
     // In our implementation, wait() requires acquiring the lock beforehand.