summaryrefslogtreecommitdiff
path: root/tests/pthread_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-02-18 17:11:56 -0800
committerElliott Hughes <enh@google.com>2021-02-18 17:23:04 -0800
commite657eb4f8abc2bb21571df1c0d0e0cbfaadce1c1 (patch)
treeece8247ab16072e2fd1fca786be9050562bb3f60 /tests/pthread_test.cpp
parent332065d57e734b65f56474d136d22d767e36cbcd (diff)
Fix some bionic death tests.
These were creating tombstones and spewing to the log. You need TEST_F() rather than TEST(), and the modern style is apparently to use `using` rather than an empty subclass. Bug: http://b/180605583 Test: run tests, check logcat Change-Id: I1e639d34854aeff6f042c24643b769a6bcfab877
Diffstat (limited to 'tests/pthread_test.cpp')
-rw-r--r--tests/pthread_test.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index d9ad3ccb4..1cbe3de35 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -45,6 +45,8 @@
#include "SignalUtils.h"
#include "utils.h"
+using pthread_DeathTest = BionicDeathTest;
+
TEST(pthread, pthread_key_create) {
pthread_key_t key;
ASSERT_EQ(0, pthread_key_create(&key, nullptr));
@@ -352,9 +354,6 @@ struct TestBug37410 {
// Even though this isn't really a death test, we have to say "DeathTest" here so gtest knows to
// run this test (which exits normally) in its own process.
-
-class pthread_DeathTest : public BionicDeathTest {};
-
TEST_F(pthread_DeathTest, pthread_bug_37410) {
// http://code.google.com/p/android/issues/detail?id=37410
ASSERT_EXIT(TestBug37410::main(), ::testing::ExitedWithCode(0), "");
@@ -2468,7 +2467,7 @@ TEST(pthread, pthread_mutex_clocklock_invalid) {
#endif // __BIONIC__
}
-TEST(pthread, pthread_mutex_using_destroyed_mutex) {
+TEST_F(pthread_DeathTest, pthread_mutex_using_destroyed_mutex) {
#if defined(__BIONIC__)
pthread_mutex_t m;
ASSERT_EQ(0, pthread_mutex_init(&m, nullptr));