diff options
| author | 2019-04-08 11:29:11 -0700 | |
|---|---|---|
| committer | 2019-04-08 20:20:18 +0000 | |
| commit | a8d23cb7febebc44ddfc03a3a135bb983eb95029 (patch) | |
| tree | 6228c445b8321eec2c813802aefa7ce593acee64 /runtime/common_runtime_test.h | |
| parent | 1ea8a62e320cb53b65910093b35240b3139b2cfa (diff) | |
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
Diffstat (limited to 'runtime/common_runtime_test.h')
| -rw-r--r-- | runtime/common_runtime_test.h | 16 |
1 files changed, 16 insertions, 0 deletions
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<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; |