Initialize `Runtime` for `MutexTest`.
Test: m test-art-host-gtest
Change-Id: I386847a163cdac79a593032191fcd3d878070ac4
diff --git a/runtime/base/mutex_test.cc b/runtime/base/mutex_test.cc
index f524d14..f1b4e49 100644
--- a/runtime/base/mutex_test.cc
+++ b/runtime/base/mutex_test.cc
@@ -16,12 +16,17 @@
#include "mutex-inl.h"
-#include "base/common_art_test.h"
+#include "common_runtime_test.h"
#include "thread-current-inl.h"
namespace art {
-class MutexTest : public CommonArtTest {};
+class MutexTest : public CommonRuntimeTest {
+ protected:
+ MutexTest() {
+ use_boot_image_ = true; // Make the Runtime creation cheaper.
+ }
+};
struct MutexTester {
static void AssertDepth(Mutex& mu, uint32_t expected_depth) {
@@ -37,6 +42,9 @@
};
TEST_F(MutexTest, LockUnlock) {
+ // TODO: Remove `Mutex` dependency on `Runtime` or at least make sure it works
+ // without a `Runtime` with reasonable defaults (and without dumping stack for timeout).
+ ASSERT_TRUE(Runtime::Current() != nullptr);
Mutex mu("test mutex");
MutexTester::AssertDepth(mu, 0U);
mu.Lock(Thread::Current());