Move ArtField to ObjPtr
Added EXPECT_OBJ_PTR_EQ and variants to gtests.
Fixed moving GC bugs in:
ClassLinker::CreatePathClassLoader
ClassLinkerTest: StaticFields
ObjPtr Decode call sites: 186 -> 181.
Some tests fail due to ResolvedFieldAccessTest, will fix in follow
up CL.
Bug: 31113334
Test: test-art-host CC baker
Change-Id: I8b266ad00f3c20c8cbe7cfdf280d175083df0b88
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index a7948e4..2158d81 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -25,10 +25,18 @@
#include "arch/instruction_set.h"
#include "base/mutex.h"
#include "globals.h"
+// TODO: Add inl file and avoid including inl.
+#include "obj_ptr-inl.h"
#include "os.h"
namespace art {
+// OBJ pointer helpers to avoid needing .Decode everywhere.
+#define EXPECT_OBJ_PTR_EQ(a, b) EXPECT_EQ(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
+#define ASSERT_OBJ_PTR_EQ(a, b) ASSERT_EQ(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
+#define EXPECT_OBJ_PTR_NE(a, b) EXPECT_NE(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
+#define ASSERT_OBJ_PTR_NE(a, b) ASSERT_NE(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
+
class ClassLinker;
class CompilerCallbacks;
class DexFile;