Commit d504c06c authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[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.
parent d3983e1e
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment