Merge pull request #25311 from wjwithagen/wjw-fix-cores-EXPECT_DEATH

test: suppress core dumping in there tests as well

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2018-11-29 19:26:45 +08:00 committed by GitHub
commit 04fb511d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "global/global_context.h"
#include "global/global_init.h"
#include "common/lockdep.h"
#include "include/coredumpctl.h"
TEST(lockdep, abba)
{
@ -24,6 +25,7 @@ TEST(lockdep, abba)
b.unlock();
b.lock();
PrCtl unset_dumpable;
EXPECT_DEATH(a.lock(), "");
b.unlock();
}
@ -34,6 +36,7 @@ TEST(lockdep, recursive)
ceph::mutex a(ceph::make_mutex("a"));
a.lock();
PrCtl unset_dumpable;
EXPECT_DEATH(a.lock(), "");
a.unlock();

View File

@ -32,6 +32,7 @@ TEST(Mutex, NormalAsserts) {
Mutex* m = new Mutex("Normal",false);
m->Lock();
testing::GTEST_FLAG(death_test_style) = "threadsafe";
PrCtl unset_dumpable;
EXPECT_DEATH(m->Lock(), ".*");
}