summaryrefslogtreecommitdiff
path: root/runtime/mirror/object_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-06-10 09:52:53 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2021-12-20 12:07:43 +0000
commitba1b94e8ebf35947e1ce127d67ab164a76ec251c (patch)
tree58f5d61d767315ef8dd2734f9be1c48532e8ce55 /runtime/mirror/object_test.cc
parentc8d57bec6249f3222e5f05f8f7e46baf06865ffe (diff)
Clean up Class::GetDirectInterface().
Fetch array interfaces from the `IfTable`. This removes the only use of the `Thread* self` argument, so we can remove that argument. We also make the function non-static to avoid the explicit `klass` argument. Similarly clean up arguments of `Class::FindClass()` and `Class::FindStaticClass()`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 (cherry picked from commit b10668cb6a34398eb720f9a6305ff9a51b3ebfd4) Merged-In: Id639b675b4eb331a777cf318eb61bd19e05de4f0 Change-Id: I34d11499aea5a95864bf1cdcb4f210547a07f33c
Diffstat (limited to 'runtime/mirror/object_test.cc')
-rw-r--r--runtime/mirror/object_test.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc
index 80ed832e95..e26cf427b4 100644
--- a/runtime/mirror/object_test.cc
+++ b/runtime/mirror/object_test.cc
@@ -147,9 +147,9 @@ TEST_F(ObjectTest, AllocObjectArray) {
Handle<mirror::Class> klass(hs.NewHandle(oa->GetClass()));
ASSERT_EQ(2U, klass->NumDirectInterfaces());
EXPECT_OBJ_PTR_EQ(class_linker_->FindSystemClass(soa.Self(), "Ljava/lang/Cloneable;"),
- mirror::Class::GetDirectInterface(soa.Self(), klass.Get(), 0));
+ klass->GetDirectInterface(0));
EXPECT_OBJ_PTR_EQ(class_linker_->FindSystemClass(soa.Self(), "Ljava/io/Serializable;"),
- mirror::Class::GetDirectInterface(soa.Self(), klass.Get(), 1));
+ klass->GetDirectInterface(1));
}
TEST_F(ObjectTest, AllocArray) {
@@ -758,20 +758,16 @@ TEST_F(ObjectTest, FindStaticField) {
// Wrong type.
EXPECT_TRUE(c->FindDeclaredStaticField("CASE_INSENSITIVE_ORDER", "I") == nullptr);
- EXPECT_TRUE(mirror::Class::FindStaticField(
- soa.Self(), c.Get(), "CASE_INSENSITIVE_ORDER", "I") == nullptr);
+ EXPECT_TRUE(c->FindStaticField("CASE_INSENSITIVE_ORDER", "I") == nullptr);
// Wrong name.
EXPECT_TRUE(c->FindDeclaredStaticField(
"cASE_INSENSITIVE_ORDER", "Ljava/util/Comparator;") == nullptr);
- EXPECT_TRUE(
- mirror::Class::FindStaticField(
- soa.Self(), c.Get(), "cASE_INSENSITIVE_ORDER", "Ljava/util/Comparator;") == nullptr);
+ EXPECT_TRUE(c->FindStaticField("cASE_INSENSITIVE_ORDER", "Ljava/util/Comparator;") == nullptr);
// Right name and type.
ArtField* f1 = c->FindDeclaredStaticField("CASE_INSENSITIVE_ORDER", "Ljava/util/Comparator;");
- ArtField* f2 = mirror::Class::FindStaticField(
- soa.Self(), c.Get(), "CASE_INSENSITIVE_ORDER", "Ljava/util/Comparator;");
+ ArtField* f2 = c->FindStaticField("CASE_INSENSITIVE_ORDER", "Ljava/util/Comparator;");
EXPECT_TRUE(f1 != nullptr);
EXPECT_TRUE(f2 != nullptr);
EXPECT_EQ(f1, f2);