Use CommonArtTest for dexlayout, dexdiag
Use the non-Runtime CommonArtTest for dexlayout and dexdiag. Also,
move some lines that should have been put in common_runtime test.h.
Bug: None
Test: build test-art-host-gtest
Change-Id: Ie2f7feb1c62de4994ea2eac368d352634e088e74
diff --git a/dexlayout/dexdiag_test.cc b/dexlayout/dexdiag_test.cc
index 47ef0a5..e220f39 100644
--- a/dexlayout/dexdiag_test.cc
+++ b/dexlayout/dexdiag_test.cc
@@ -17,8 +17,7 @@
#include <string>
#include <vector>
-#include "common_runtime_test.h"
-
+#include "base/common_art_test.h"
#include "base/file_utils.h"
#include "base/os.h"
#include "exec_utils.h"
@@ -32,10 +31,10 @@
static const char* kDexDiagVerbose = "--verbose";
static const char* kDexDiagBinaryName = "dexdiag";
-class DexDiagTest : public CommonRuntimeTest {
+class DexDiagTest : public CommonArtTest {
protected:
void SetUp() override {
- CommonRuntimeTest::SetUp();
+ CommonArtTest::SetUp();
}
// Path to the dexdiag(d?)[32|64] binary.
diff --git a/dexlayout/dexlayout_test.cc b/dexlayout/dexlayout_test.cc
index 3124cf6..0964619 100644
--- a/dexlayout/dexlayout_test.cc
+++ b/dexlayout/dexlayout_test.cc
@@ -23,7 +23,7 @@
#include "base/unix_file/fd_file.h"
#include "base/utils.h"
-#include "common_runtime_test.h"
+#include "base/common_art_test.h"
#include "dex/art_dex_file_loader.h"
#include "dex/base64_test_util.h"
#include "dex/class_accessor-inl.h"
@@ -250,7 +250,7 @@
}
}
-class DexLayoutTest : public CommonRuntimeTest {
+class DexLayoutTest : public CommonArtTest {
protected:
std::string GetDexLayoutPath() {
return GetTestAndroidRoot() + "/bin/dexlayoutd";
diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h
index 9b23d15..a1f7cbb 100644
--- a/libartbase/base/common_art_test.h
+++ b/libartbase/base/common_art_test.h
@@ -32,29 +32,12 @@
#include "base/unix_file/fd_file.h"
#include "dex/art_dex_file_loader.h"
#include "dex/compact_dex_level.h"
-#include "obj_ptr-inl.h"
namespace art {
using LogSeverity = android::base::LogSeverity;
using ScopedLogSeverity = android::base::ScopedLogSeverity;
-template<class MirrorType>
-static inline ObjPtr<MirrorType> MakeObjPtr(MirrorType* ptr) {
- return ptr;
-}
-
-template<class MirrorType>
-static inline ObjPtr<MirrorType> MakeObjPtr(ObjPtr<MirrorType> ptr) {
- return ptr;
-}
-
-// OBJ pointer helpers to avoid needing .Decode everywhere.
-#define EXPECT_OBJ_PTR_EQ(a, b) EXPECT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
-#define ASSERT_OBJ_PTR_EQ(a, b) ASSERT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
-#define EXPECT_OBJ_PTR_NE(a, b) EXPECT_NE(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
-#define ASSERT_OBJ_PTR_NE(a, b) ASSERT_NE(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
-
class DexFile;
class ScratchFile {
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index fb3eae7..9e36888 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -41,6 +41,22 @@
using LogSeverity = android::base::LogSeverity;
using ScopedLogSeverity = android::base::ScopedLogSeverity;
+template<class MirrorType>
+static inline ObjPtr<MirrorType> MakeObjPtr(MirrorType* ptr) {
+ return ptr;
+}
+
+template<class MirrorType>
+static inline ObjPtr<MirrorType> MakeObjPtr(ObjPtr<MirrorType> ptr) {
+ return ptr;
+}
+
+// OBJ pointer helpers to avoid needing .Decode everywhere.
+#define EXPECT_OBJ_PTR_EQ(a, b) EXPECT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
+#define ASSERT_OBJ_PTR_EQ(a, b) ASSERT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
+#define EXPECT_OBJ_PTR_NE(a, b) EXPECT_NE(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
+#define ASSERT_OBJ_PTR_NE(a, b) ASSERT_NE(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr())
+
class ClassLinker;
class CompilerCallbacks;
class DexFile;