From a8d23cb7febebc44ddfc03a3a135bb983eb95029 Mon Sep 17 00:00:00 2001 From: David Sehr Date: Mon, 8 Apr 2019 11:29:11 -0700 Subject: 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 --- runtime/common_runtime_test.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'runtime/common_runtime_test.h') diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h index fb3eae75dc..9e3688855c 100644 --- a/runtime/common_runtime_test.h +++ b/runtime/common_runtime_test.h @@ -41,6 +41,22 @@ namespace art { using LogSeverity = android::base::LogSeverity; using ScopedLogSeverity = android::base::ScopedLogSeverity; +template +static inline ObjPtr MakeObjPtr(MirrorType* ptr) { + return ptr; +} + +template +static inline ObjPtr MakeObjPtr(ObjPtr 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; -- cgit v1.2.3-59-g8ed1b