Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 3 | #include "common_test.h" |
| 4 | #include "class_linker.h" |
| 5 | #include "dex_file.h" |
| 6 | #include "heap.h" |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 7 | #include "gtest/gtest.h" |
| 8 | |
| 9 | namespace art { |
| 10 | |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 11 | class ClassLinkerTest : public RuntimeTest { |
| 12 | protected: |
| 13 | void AssertNonExistantClass(const StringPiece& descriptor) { |
| 14 | EXPECT_TRUE(class_linker_.get()->FindSystemClass(descriptor) == NULL); |
| 15 | } |
| 16 | |
| 17 | void AssertPrimitiveClass(const StringPiece& descriptor) { |
| 18 | Class* primitive = class_linker_.get()->FindSystemClass(descriptor); |
| 19 | ASSERT_TRUE(primitive != NULL); |
| 20 | ASSERT_TRUE(primitive->GetClass() != NULL); |
| 21 | ASSERT_EQ(primitive->GetClass(), primitive->GetClass()->GetClass()); |
| 22 | EXPECT_TRUE(primitive->GetClass()->GetSuperClass() != NULL); |
| 23 | ASSERT_EQ(descriptor, primitive->GetDescriptor()); |
| 24 | EXPECT_TRUE(primitive->GetSuperClass() == NULL); |
| 25 | EXPECT_FALSE(primitive->HasSuperClass()); |
| 26 | EXPECT_TRUE(primitive->GetComponentType() == NULL); |
| 27 | EXPECT_TRUE(primitive->GetStatus() == Class::kStatusInitialized); |
| 28 | EXPECT_FALSE(primitive->IsErroneous()); |
| 29 | EXPECT_TRUE(primitive->IsVerified()); |
| 30 | EXPECT_TRUE(primitive->IsLinked()); |
| 31 | EXPECT_FALSE(primitive->IsArray()); |
| 32 | EXPECT_EQ(0, primitive->array_rank_); |
| 33 | EXPECT_FALSE(primitive->IsInterface()); |
| 34 | EXPECT_TRUE(primitive->IsPublic()); |
| 35 | EXPECT_TRUE(primitive->IsFinal()); |
| 36 | EXPECT_TRUE(primitive->IsPrimitive()); |
| 37 | EXPECT_EQ(0U, primitive->NumDirectMethods()); |
| 38 | EXPECT_EQ(0U, primitive->NumVirtualMethods()); |
| 39 | EXPECT_EQ(0U, primitive->NumInstanceFields()); |
| 40 | EXPECT_EQ(0U, primitive->NumStaticFields()); |
Brian Carlstrom | 913af1b | 2011-07-23 21:41:13 -0700 | [diff] [blame^] | 41 | EXPECT_EQ(0U, primitive->NumInterfaces()); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | void AssertArrayClass(const StringPiece& array_descriptor, |
| 45 | int32_t array_rank, |
| 46 | const StringPiece& component_type) { |
| 47 | Class* array = class_linker_.get()->FindSystemClass(array_descriptor); |
| 48 | ASSERT_TRUE(array != NULL); |
| 49 | ASSERT_TRUE(array->GetClass() != NULL); |
| 50 | ASSERT_EQ(array->GetClass(), array->GetClass()->GetClass()); |
| 51 | EXPECT_TRUE(array->GetClass()->GetSuperClass() != NULL); |
| 52 | ASSERT_EQ(array_descriptor, array->GetDescriptor()); |
| 53 | EXPECT_TRUE(array->GetSuperClass() != NULL); |
| 54 | EXPECT_EQ(class_linker_.get()->FindSystemClass("Ljava/lang/Object;"), array->GetSuperClass()); |
| 55 | EXPECT_TRUE(array->HasSuperClass()); |
| 56 | ASSERT_TRUE(array->GetComponentType() != NULL); |
| 57 | ASSERT_TRUE(array->GetComponentType()->GetDescriptor() != NULL); |
| 58 | EXPECT_EQ(component_type, array->GetComponentType()->GetDescriptor()); |
| 59 | EXPECT_TRUE(array->GetStatus() == Class::kStatusInitialized); |
| 60 | EXPECT_FALSE(array->IsErroneous()); |
| 61 | EXPECT_TRUE(array->IsVerified()); |
| 62 | EXPECT_TRUE(array->IsLinked()); |
| 63 | EXPECT_TRUE(array->IsArray()); |
| 64 | EXPECT_EQ(array_rank, array->array_rank_); |
| 65 | EXPECT_FALSE(array->IsInterface()); |
| 66 | EXPECT_EQ(array->GetComponentType()->IsPublic(), array->IsPublic()); |
| 67 | EXPECT_TRUE(array->IsFinal()); |
| 68 | EXPECT_FALSE(array->IsPrimitive()); |
| 69 | EXPECT_EQ(0U, array->NumDirectMethods()); |
| 70 | EXPECT_EQ(0U, array->NumVirtualMethods()); |
| 71 | EXPECT_EQ(0U, array->NumInstanceFields()); |
| 72 | EXPECT_EQ(0U, array->NumStaticFields()); |
Brian Carlstrom | 913af1b | 2011-07-23 21:41:13 -0700 | [diff] [blame^] | 73 | EXPECT_EQ(2U, array->NumInterfaces()); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 74 | } |
| 75 | }; |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 76 | |
| 77 | TEST_F(ClassLinkerTest, FindClassNonexistent) { |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 78 | Class* result1 = class_linker_.get()->FindSystemClass("NoSuchClass;"); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 79 | EXPECT_TRUE(result1 == NULL); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 80 | Class* result2 = class_linker_.get()->FindSystemClass("LNoSuchClass;"); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 81 | EXPECT_TRUE(result2 == NULL); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 84 | TEST_F(ClassLinkerTest, FindClassNested) { |
Brian Carlstrom | f3eb61f | 2011-07-23 20:22:26 -0700 | [diff] [blame] | 85 | scoped_ptr<DexFile> nested_dex(OpenDexFileBase64(kNestedDex)); |
| 86 | class_linker_.get()->RegisterDexFile(nested_dex.get()); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 87 | |
Brian Carlstrom | f3eb61f | 2011-07-23 20:22:26 -0700 | [diff] [blame] | 88 | Class* outer = class_linker_.get()->FindClass("LNested;", NULL, nested_dex.get()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 89 | ASSERT_TRUE(outer != NULL); |
| 90 | EXPECT_EQ(0U, outer->NumVirtualMethods()); |
| 91 | EXPECT_EQ(1U, outer->NumDirectMethods()); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 92 | |
Brian Carlstrom | f3eb61f | 2011-07-23 20:22:26 -0700 | [diff] [blame] | 93 | Class* inner = class_linker_.get()->FindClass("LNested$Inner;", NULL, nested_dex.get()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 94 | ASSERT_TRUE(inner != NULL); |
| 95 | EXPECT_EQ(0U, inner->NumVirtualMethods()); |
| 96 | EXPECT_EQ(1U, inner->NumDirectMethods()); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 97 | } |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 98 | |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 99 | TEST_F(ClassLinkerTest, FindClass) { |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 100 | ClassLinker* linker = class_linker_.get(); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 101 | |
| 102 | StringPiece expected = "BCDFIJSZV"; |
| 103 | for (int ch = 0; ch < 255; ch++) { |
| 104 | char* s = reinterpret_cast<char*>(&ch); |
| 105 | StringPiece descriptor(s, 1); |
| 106 | if (expected.find(ch) == StringPiece::npos) { |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 107 | AssertNonExistantClass(descriptor); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 108 | } else { |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 109 | AssertPrimitiveClass(descriptor); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 110 | } |
| 111 | } |
Elliott Hughes | a5780da | 2011-07-17 11:39:39 -0700 | [diff] [blame] | 112 | |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 113 | Class* JavaLangObject = linker->FindSystemClass("Ljava/lang/Object;"); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 114 | ASSERT_TRUE(JavaLangObject != NULL); |
Brian Carlstrom | a080803 | 2011-07-18 00:39:23 -0700 | [diff] [blame] | 115 | ASSERT_TRUE(JavaLangObject->GetClass() != NULL); |
| 116 | ASSERT_EQ(JavaLangObject->GetClass(), JavaLangObject->GetClass()->GetClass()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 117 | EXPECT_EQ(JavaLangObject, JavaLangObject->GetClass()->GetSuperClass()); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 118 | ASSERT_TRUE(JavaLangObject->GetDescriptor() == "Ljava/lang/Object;"); |
| 119 | EXPECT_TRUE(JavaLangObject->GetSuperClass() == NULL); |
| 120 | EXPECT_FALSE(JavaLangObject->HasSuperClass()); |
| 121 | EXPECT_TRUE(JavaLangObject->GetComponentType() == NULL); |
| 122 | EXPECT_FALSE(JavaLangObject->IsErroneous()); |
| 123 | EXPECT_FALSE(JavaLangObject->IsVerified()); |
| 124 | EXPECT_TRUE(JavaLangObject->IsLinked()); |
| 125 | EXPECT_FALSE(JavaLangObject->IsArray()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 126 | EXPECT_EQ(0, JavaLangObject->array_rank_); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 127 | EXPECT_FALSE(JavaLangObject->IsInterface()); |
| 128 | EXPECT_TRUE(JavaLangObject->IsPublic()); |
| 129 | EXPECT_FALSE(JavaLangObject->IsFinal()); |
| 130 | EXPECT_FALSE(JavaLangObject->IsPrimitive()); |
Carl Shapiro | f10edca | 2011-07-14 23:16:21 -0700 | [diff] [blame] | 131 | EXPECT_EQ(1U, JavaLangObject->NumDirectMethods()); |
| 132 | EXPECT_EQ(0U, JavaLangObject->NumVirtualMethods()); |
| 133 | EXPECT_EQ(0U, JavaLangObject->NumInstanceFields()); |
| 134 | EXPECT_EQ(0U, JavaLangObject->NumStaticFields()); |
Brian Carlstrom | 913af1b | 2011-07-23 21:41:13 -0700 | [diff] [blame^] | 135 | EXPECT_EQ(0U, JavaLangObject->NumInterfaces()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 136 | |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 137 | |
Brian Carlstrom | f615a61 | 2011-07-23 12:50:34 -0700 | [diff] [blame] | 138 | scoped_ptr<DexFile> dex(OpenDexFileBase64(kMyClassDex)); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 139 | linker->RegisterDexFile(dex.get()); |
| 140 | EXPECT_TRUE(linker->FindSystemClass("LMyClass;") == NULL); |
| 141 | Class* MyClass = linker->FindClass("LMyClass;", NULL, dex.get()); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 142 | ASSERT_TRUE(MyClass != NULL); |
Brian Carlstrom | a080803 | 2011-07-18 00:39:23 -0700 | [diff] [blame] | 143 | ASSERT_TRUE(MyClass->GetClass() != NULL); |
| 144 | ASSERT_EQ(MyClass->GetClass(), MyClass->GetClass()->GetClass()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 145 | EXPECT_EQ(JavaLangObject, MyClass->GetClass()->GetSuperClass()); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 146 | ASSERT_TRUE(MyClass->GetDescriptor() == "LMyClass;"); |
| 147 | EXPECT_TRUE(MyClass->GetSuperClass() == JavaLangObject); |
| 148 | EXPECT_TRUE(MyClass->HasSuperClass()); |
| 149 | EXPECT_TRUE(MyClass->GetComponentType() == NULL); |
| 150 | EXPECT_TRUE(MyClass->GetStatus() == Class::kStatusResolved); |
| 151 | EXPECT_FALSE(MyClass->IsErroneous()); |
| 152 | EXPECT_FALSE(MyClass->IsVerified()); |
| 153 | EXPECT_TRUE(MyClass->IsLinked()); |
| 154 | EXPECT_FALSE(MyClass->IsArray()); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 155 | EXPECT_EQ(0, JavaLangObject->array_rank_); |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 156 | EXPECT_FALSE(MyClass->IsInterface()); |
| 157 | EXPECT_FALSE(MyClass->IsPublic()); |
| 158 | EXPECT_FALSE(MyClass->IsFinal()); |
| 159 | EXPECT_FALSE(MyClass->IsPrimitive()); |
Carl Shapiro | f10edca | 2011-07-14 23:16:21 -0700 | [diff] [blame] | 160 | EXPECT_EQ(1U, MyClass->NumDirectMethods()); |
| 161 | EXPECT_EQ(0U, MyClass->NumVirtualMethods()); |
| 162 | EXPECT_EQ(0U, MyClass->NumInstanceFields()); |
| 163 | EXPECT_EQ(0U, MyClass->NumStaticFields()); |
Brian Carlstrom | 913af1b | 2011-07-23 21:41:13 -0700 | [diff] [blame^] | 164 | EXPECT_EQ(0U, MyClass->NumInterfaces()); |
Brian Carlstrom | a080803 | 2011-07-18 00:39:23 -0700 | [diff] [blame] | 165 | |
| 166 | EXPECT_EQ(JavaLangObject->GetClass()->GetClass(), MyClass->GetClass()->GetClass()); |
| 167 | |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 168 | // created by class_linker |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 169 | AssertArrayClass("[C", 1, "C"); |
| 170 | AssertArrayClass("[Ljava/lang/Object;", 1, "Ljava/lang/Object;"); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 171 | // synthesized on the fly |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 172 | AssertArrayClass("[[C", 2, "C"); |
| 173 | AssertArrayClass("[[[LMyClass;", 3, "LMyClass;"); |
Brian Carlstrom | a331b3c | 2011-07-18 17:47:56 -0700 | [diff] [blame] | 174 | // or not available at all |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 175 | AssertNonExistantClass("[[[[LNonExistantClass;"); |
| 176 | } |
| 177 | |
| 178 | TEST_F(ClassLinkerTest, ProtoCompare) { |
| 179 | ClassLinker* linker = class_linker_.get(); |
| 180 | |
Brian Carlstrom | f615a61 | 2011-07-23 12:50:34 -0700 | [diff] [blame] | 181 | scoped_ptr<DexFile> proto_dex_file(OpenDexFileBase64(kProtoCompareDex)); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 182 | linker->RegisterDexFile(proto_dex_file.get()); |
| 183 | |
| 184 | Class* klass = linker->FindClass("LProtoCompare;", NULL, proto_dex_file.get()); |
| 185 | ASSERT_TRUE(klass != NULL); |
| 186 | |
| 187 | ASSERT_EQ(4U, klass->NumVirtualMethods()); |
| 188 | |
| 189 | Method* m1 = klass->GetVirtualMethod(0); |
| 190 | ASSERT_EQ("m1", m1->GetName()); |
| 191 | |
| 192 | Method* m2 = klass->GetVirtualMethod(1); |
| 193 | ASSERT_EQ("m2", m2->GetName()); |
| 194 | |
| 195 | Method* m3 = klass->GetVirtualMethod(2); |
| 196 | ASSERT_EQ("m3", m3->GetName()); |
| 197 | |
| 198 | Method* m4 = klass->GetVirtualMethod(3); |
| 199 | ASSERT_EQ("m4", m4->GetName()); |
| 200 | |
| 201 | EXPECT_TRUE(linker->HasSameReturnType(m1, m2)); |
| 202 | EXPECT_TRUE(linker->HasSameReturnType(m2, m1)); |
| 203 | |
| 204 | EXPECT_TRUE(linker->HasSameReturnType(m1, m2)); |
| 205 | EXPECT_TRUE(linker->HasSameReturnType(m2, m1)); |
| 206 | |
| 207 | EXPECT_FALSE(linker->HasSameReturnType(m1, m4)); |
| 208 | EXPECT_FALSE(linker->HasSameReturnType(m4, m1)); |
| 209 | |
| 210 | EXPECT_TRUE(linker->HasSameArgumentTypes(m1, m2)); |
| 211 | EXPECT_TRUE(linker->HasSameArgumentTypes(m2, m1)); |
| 212 | |
| 213 | EXPECT_FALSE(linker->HasSameArgumentTypes(m1, m3)); |
| 214 | EXPECT_FALSE(linker->HasSameArgumentTypes(m3, m1)); |
| 215 | |
| 216 | EXPECT_FALSE(linker->HasSameArgumentTypes(m1, m4)); |
| 217 | EXPECT_FALSE(linker->HasSameArgumentTypes(m4, m1)); |
| 218 | |
| 219 | EXPECT_TRUE(linker->HasSamePrototype(m1, m2)); |
| 220 | EXPECT_TRUE(linker->HasSamePrototype(m2, m1)); |
| 221 | |
| 222 | EXPECT_FALSE(linker->HasSamePrototype(m1, m3)); |
| 223 | EXPECT_FALSE(linker->HasSamePrototype(m3, m1)); |
| 224 | |
| 225 | EXPECT_FALSE(linker->HasSamePrototype(m3, m4)); |
| 226 | EXPECT_FALSE(linker->HasSamePrototype(m4, m3)); |
| 227 | |
| 228 | EXPECT_FALSE(linker->HasSameName(m1, m2)); |
| 229 | EXPECT_FALSE(linker->HasSameNameAndPrototype(m1, m2)); |
| 230 | } |
| 231 | |
| 232 | TEST_F(ClassLinkerTest, ProtoCompare2) { |
| 233 | ClassLinker* linker = class_linker_.get(); |
| 234 | |
Brian Carlstrom | f615a61 | 2011-07-23 12:50:34 -0700 | [diff] [blame] | 235 | scoped_ptr<DexFile> proto1_dex_file(OpenDexFileBase64(kProtoCompareDex)); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 236 | linker->RegisterDexFile(proto1_dex_file.get()); |
Brian Carlstrom | f615a61 | 2011-07-23 12:50:34 -0700 | [diff] [blame] | 237 | scoped_ptr<DexFile> proto2_dex_file(OpenDexFileBase64(kProtoCompare2Dex)); |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 238 | linker->RegisterDexFile(proto2_dex_file.get()); |
| 239 | |
| 240 | Class* klass1 = linker->FindClass("LProtoCompare;", NULL, proto1_dex_file.get()); |
| 241 | ASSERT_TRUE(klass1 != NULL); |
| 242 | Class* klass2 = linker->FindClass("LProtoCompare2;", NULL, proto2_dex_file.get()); |
| 243 | ASSERT_TRUE(klass2 != NULL); |
| 244 | |
| 245 | Method* m1_1 = klass1->GetVirtualMethod(0); |
| 246 | ASSERT_EQ("m1", m1_1->GetName()); |
| 247 | Method* m2_1 = klass1->GetVirtualMethod(1); |
| 248 | ASSERT_EQ("m2", m2_1->GetName()); |
| 249 | Method* m3_1 = klass1->GetVirtualMethod(2); |
| 250 | ASSERT_EQ("m3", m3_1->GetName()); |
| 251 | Method* m4_1 = klass1->GetVirtualMethod(3); |
| 252 | ASSERT_EQ("m4", m4_1->GetName()); |
| 253 | |
| 254 | Method* m1_2 = klass2->GetVirtualMethod(0); |
| 255 | ASSERT_EQ("m1", m1_2->GetName()); |
| 256 | Method* m2_2 = klass2->GetVirtualMethod(1); |
| 257 | ASSERT_EQ("m2", m2_2->GetName()); |
| 258 | Method* m3_2 = klass2->GetVirtualMethod(2); |
| 259 | ASSERT_EQ("m3", m3_2->GetName()); |
| 260 | Method* m4_2 = klass2->GetVirtualMethod(3); |
| 261 | ASSERT_EQ("m4", m4_2->GetName()); |
| 262 | |
| 263 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m1_1, m1_2)); |
| 264 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m1_2, m1_1)); |
| 265 | |
| 266 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m2_1, m2_2)); |
| 267 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m2_2, m2_1)); |
| 268 | |
| 269 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m3_1, m3_2)); |
| 270 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m3_2, m3_1)); |
| 271 | |
| 272 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m4_1, m4_2)); |
| 273 | EXPECT_TRUE(linker->HasSameNameAndPrototype(m4_2, m4_1)); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | } // namespace art |