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/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;