diff options
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; |