Commit f49a4068 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[master] Disable MutexTest.destoryLocked on Solaris

parent dc3884d6
......@@ -217,6 +217,10 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
# "now" binding is necessary to prevent deadlocks in C++ static initialization code
LDFLAGS="$LDFLAGS -z now"
# Destroying locked mutexes, condition variables being waited
# on, etc. are undefined behavior on Solaris, so we set it as
# such here.
AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
;;
*-apple-darwin*)
# Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use
......
......@@ -12,6 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <config.h>
#include <gtest/gtest.h>
#include <util/threads/sync.h>
......@@ -46,11 +48,11 @@ TEST(MutexTest, lockMultiple) {
#endif // ENABLE_DEBUG
#ifndef HAS_UNDEFINED_PTHREAD_BEHAVIOR
// Destroying a locked mutex is a bad idea as well
#ifdef EXPECT_DEATH
TEST(MutexTest, destroyLocked) {
if (!isc::util::unittests::runningOnValgrind()) {
EXPECT_DEATH({
EXPECT_DEATH_IF_SUPPORTED({
Mutex* mutex = new Mutex;
new Mutex::Locker(*mutex);
delete mutex;
......@@ -59,7 +61,7 @@ TEST(MutexTest, destroyLocked) {
}, "");
}
}
#endif
#endif // !HAS_UNDEFINED_PTHREAD_BEHAVIOR
// In this test, we try to check if a mutex really locks. We could try that
// with a deadlock, but that's not practical (the test would not end).
......
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