MutexTest.destroyLocked breaks a some systems
There are at least two systems where the MutexTest.destroyLocked unit test does not work even they not have HAS_UNDEFINED_PTHREAD_BEHAVIOR set. This test adds undefined pthread behavior to gtest DEATH testing so it is not surprising it is a common source of problems.
Three solutions:
- do nothing.
- reverse the HAS_UNDEFINED_PTHREAD_BEHAVIOR flag.
- simply unconditionally disable it.
Remember the current code:
// Destroying a locked mutex is a bad idea as well
#ifdef HAS_UNDEFINED_PTHREAD_BEHAVIOR
TEST(MutexTest, DISABLED_destroyLocked) {
#else
TEST(MutexTest, destroyLocked) {
#endif
if (!isc::util::unittests::runningOnValgrind()) {
EXPECT_DEATH_IF_SUPPORTED({
Mutex* mutex = new Mutex;
new Mutex::Locker(*mutex);
delete mutex;
// This'll leak the locker, but inside the slave process, it should
// not be an issue.
}, "");
}
}