1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "reflection.h"
18 
19 #include <float.h>
20 #include <limits.h>
21 #include "ScopedLocalRef.h"
22 
23 #include "common_compiler_test.h"
24 #include "mirror/art_method-inl.h"
25 #include "scoped_thread_state_change.h"
26 
27 namespace art {
28 
29 // TODO: Convert to CommonRuntimeTest. Currently MakeExecutable is used.
30 class ReflectionTest : public CommonCompilerTest {
31  protected:
SetUp()32   virtual void SetUp() {
33     CommonCompilerTest::SetUp();
34 
35     vm_ = Runtime::Current()->GetJavaVM();
36 
37     // Turn on -verbose:jni for the JNI tests.
38     // gLogVerbosity.jni = true;
39 
40     vm_->AttachCurrentThread(&env_, NULL);
41 
42     ScopedLocalRef<jclass> aioobe(env_,
43                                   env_->FindClass("java/lang/ArrayIndexOutOfBoundsException"));
44     CHECK(aioobe.get() != NULL);
45     aioobe_ = reinterpret_cast<jclass>(env_->NewGlobalRef(aioobe.get()));
46 
47     ScopedLocalRef<jclass> ase(env_, env_->FindClass("java/lang/ArrayStoreException"));
48     CHECK(ase.get() != NULL);
49     ase_ = reinterpret_cast<jclass>(env_->NewGlobalRef(ase.get()));
50 
51     ScopedLocalRef<jclass> sioobe(env_,
52                                   env_->FindClass("java/lang/StringIndexOutOfBoundsException"));
53     CHECK(sioobe.get() != NULL);
54     sioobe_ = reinterpret_cast<jclass>(env_->NewGlobalRef(sioobe.get()));
55   }
56 
CleanUpJniEnv()57   void CleanUpJniEnv() {
58     if (aioobe_ != NULL) {
59       env_->DeleteGlobalRef(aioobe_);
60       aioobe_ = NULL;
61     }
62     if (ase_ != NULL) {
63       env_->DeleteGlobalRef(ase_);
64       ase_ = NULL;
65     }
66     if (sioobe_ != NULL) {
67       env_->DeleteGlobalRef(sioobe_);
68       sioobe_ = NULL;
69     }
70   }
71 
TearDown()72   virtual void TearDown() {
73     CleanUpJniEnv();
74     CommonCompilerTest::TearDown();
75   }
76 
GetPrimitiveClass(char descriptor)77   jclass GetPrimitiveClass(char descriptor) {
78     ScopedObjectAccess soa(env_);
79     mirror::Class* c = class_linker_->FindPrimitiveClass(descriptor);
80     CHECK(c != nullptr);
81     return soa.AddLocalReference<jclass>(c);
82   }
83 
ReflectionTestMakeExecutable(mirror::ArtMethod ** method,mirror::Object ** receiver,bool is_static,const char * method_name,const char * method_signature)84   void ReflectionTestMakeExecutable(mirror::ArtMethod** method,
85                                     mirror::Object** receiver,
86                                     bool is_static, const char* method_name,
87                                     const char* method_signature)
88       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
89     const char* class_name = is_static ? "StaticLeafMethods" : "NonStaticLeafMethods";
90     jobject jclass_loader(LoadDex(class_name));
91     Thread* self = Thread::Current();
92     StackHandleScope<2> hs(self);
93     Handle<mirror::ClassLoader> class_loader(
94         hs.NewHandle(
95             ScopedObjectAccessUnchecked(self).Decode<mirror::ClassLoader*>(jclass_loader)));
96     if (is_static) {
97       MakeExecutable(ScopedObjectAccessUnchecked(self).Decode<mirror::ClassLoader*>(jclass_loader),
98                      class_name);
99     } else {
100       MakeExecutable(nullptr, "java.lang.Class");
101       MakeExecutable(nullptr, "java.lang.Object");
102       MakeExecutable(ScopedObjectAccessUnchecked(self).Decode<mirror::ClassLoader*>(jclass_loader),
103                      class_name);
104     }
105 
106     mirror::Class* c = class_linker_->FindClass(self, DotToDescriptor(class_name).c_str(),
107                                                 class_loader);
108     CHECK(c != NULL);
109 
110     *method = is_static ? c->FindDirectMethod(method_name, method_signature)
111                         : c->FindVirtualMethod(method_name, method_signature);
112     CHECK(method != nullptr);
113 
114     if (is_static) {
115       *receiver = nullptr;
116     } else {
117       // Ensure class is initialized before allocating object
118       StackHandleScope<1> hs(self);
119       Handle<mirror::Class> h_class(hs.NewHandle(c));
120       bool initialized = class_linker_->EnsureInitialized(h_class, true, true);
121       CHECK(initialized);
122       *receiver = c->AllocObject(self);
123     }
124 
125     // Start runtime.
126     bool started = runtime_->Start();
127     CHECK(started);
128     self->TransitionFromSuspendedToRunnable();
129   }
130 
InvokeNopMethod(bool is_static)131   void InvokeNopMethod(bool is_static) {
132     ScopedObjectAccess soa(env_);
133     mirror::ArtMethod* method;
134     mirror::Object* receiver;
135     ReflectionTestMakeExecutable(&method, &receiver, is_static, "nop", "()V");
136     InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), nullptr);
137   }
138 
InvokeIdentityByteMethod(bool is_static)139   void InvokeIdentityByteMethod(bool is_static) {
140     ScopedObjectAccess soa(env_);
141     mirror::ArtMethod* method;
142     mirror::Object* receiver;
143     ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(B)B");
144     jvalue args[1];
145 
146     args[0].b = 0;
147     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
148     EXPECT_EQ(0, result.GetB());
149 
150     args[0].b = -1;
151     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
152     EXPECT_EQ(-1, result.GetB());
153 
154     args[0].b = SCHAR_MAX;
155     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
156     EXPECT_EQ(SCHAR_MAX, result.GetB());
157 
158     args[0].b = (SCHAR_MIN << 24) >> 24;
159     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
160     EXPECT_EQ(SCHAR_MIN, result.GetB());
161   }
162 
InvokeIdentityIntMethod(bool is_static)163   void InvokeIdentityIntMethod(bool is_static) {
164     ScopedObjectAccess soa(env_);
165     mirror::ArtMethod* method;
166     mirror::Object* receiver;
167     ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(I)I");
168     jvalue args[1];
169 
170     args[0].i = 0;
171     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
172     EXPECT_EQ(0, result.GetI());
173 
174     args[0].i = -1;
175     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
176     EXPECT_EQ(-1, result.GetI());
177 
178     args[0].i = INT_MAX;
179     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
180     EXPECT_EQ(INT_MAX, result.GetI());
181 
182     args[0].i = INT_MIN;
183     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
184     EXPECT_EQ(INT_MIN, result.GetI());
185   }
186 
InvokeIdentityDoubleMethod(bool is_static)187   void InvokeIdentityDoubleMethod(bool is_static) {
188     ScopedObjectAccess soa(env_);
189     mirror::ArtMethod* method;
190     mirror::Object* receiver;
191     ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(D)D");
192     jvalue args[1];
193 
194     args[0].d = 0.0;
195     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
196     EXPECT_EQ(0.0, result.GetD());
197 
198     args[0].d = -1.0;
199     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
200     EXPECT_EQ(-1.0, result.GetD());
201 
202     args[0].d = DBL_MAX;
203     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
204     EXPECT_EQ(DBL_MAX, result.GetD());
205 
206     args[0].d = DBL_MIN;
207     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
208     EXPECT_EQ(DBL_MIN, result.GetD());
209   }
210 
InvokeSumIntIntMethod(bool is_static)211   void InvokeSumIntIntMethod(bool is_static) {
212     ScopedObjectAccess soa(env_);
213     mirror::ArtMethod* method;
214     mirror::Object* receiver;
215     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(II)I");
216     jvalue args[2];
217 
218     args[0].i = 1;
219     args[1].i = 2;
220     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
221     EXPECT_EQ(3, result.GetI());
222 
223     args[0].i = -2;
224     args[1].i = 5;
225     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
226     EXPECT_EQ(3, result.GetI());
227 
228     args[0].i = INT_MAX;
229     args[1].i = INT_MIN;
230     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
231     EXPECT_EQ(-1, result.GetI());
232 
233     args[0].i = INT_MAX;
234     args[1].i = INT_MAX;
235     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
236     EXPECT_EQ(-2, result.GetI());
237   }
238 
InvokeSumIntIntIntMethod(bool is_static)239   void InvokeSumIntIntIntMethod(bool is_static) {
240     ScopedObjectAccess soa(env_);
241     mirror::ArtMethod* method;
242     mirror::Object* receiver;
243     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(III)I");
244     jvalue args[3];
245 
246     args[0].i = 0;
247     args[1].i = 0;
248     args[2].i = 0;
249     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
250     EXPECT_EQ(0, result.GetI());
251 
252     args[0].i = 1;
253     args[1].i = 2;
254     args[2].i = 3;
255     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
256     EXPECT_EQ(6, result.GetI());
257 
258     args[0].i = -1;
259     args[1].i = 2;
260     args[2].i = -3;
261     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
262     EXPECT_EQ(-2, result.GetI());
263 
264     args[0].i = INT_MAX;
265     args[1].i = INT_MIN;
266     args[2].i = INT_MAX;
267     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
268     EXPECT_EQ(2147483646, result.GetI());
269 
270     args[0].i = INT_MAX;
271     args[1].i = INT_MAX;
272     args[2].i = INT_MAX;
273     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
274     EXPECT_EQ(2147483645, result.GetI());
275   }
276 
InvokeSumIntIntIntIntMethod(bool is_static)277   void InvokeSumIntIntIntIntMethod(bool is_static) {
278     ScopedObjectAccess soa(env_);
279     mirror::ArtMethod* method;
280     mirror::Object* receiver;
281     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(IIII)I");
282     jvalue args[4];
283 
284     args[0].i = 0;
285     args[1].i = 0;
286     args[2].i = 0;
287     args[3].i = 0;
288     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
289     EXPECT_EQ(0, result.GetI());
290 
291     args[0].i = 1;
292     args[1].i = 2;
293     args[2].i = 3;
294     args[3].i = 4;
295     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
296     EXPECT_EQ(10, result.GetI());
297 
298     args[0].i = -1;
299     args[1].i = 2;
300     args[2].i = -3;
301     args[3].i = 4;
302     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
303     EXPECT_EQ(2, result.GetI());
304 
305     args[0].i = INT_MAX;
306     args[1].i = INT_MIN;
307     args[2].i = INT_MAX;
308     args[3].i = INT_MIN;
309     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
310     EXPECT_EQ(-2, result.GetI());
311 
312     args[0].i = INT_MAX;
313     args[1].i = INT_MAX;
314     args[2].i = INT_MAX;
315     args[3].i = INT_MAX;
316     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
317     EXPECT_EQ(-4, result.GetI());
318   }
319 
InvokeSumIntIntIntIntIntMethod(bool is_static)320   void InvokeSumIntIntIntIntIntMethod(bool is_static) {
321     ScopedObjectAccess soa(env_);
322     mirror::ArtMethod* method;
323     mirror::Object* receiver;
324     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(IIIII)I");
325     jvalue args[5];
326 
327     args[0].i = 0;
328     args[1].i = 0;
329     args[2].i = 0;
330     args[3].i = 0;
331     args[4].i = 0;
332     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
333     EXPECT_EQ(0, result.GetI());
334 
335     args[0].i = 1;
336     args[1].i = 2;
337     args[2].i = 3;
338     args[3].i = 4;
339     args[4].i = 5;
340     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
341     EXPECT_EQ(15, result.GetI());
342 
343     args[0].i = -1;
344     args[1].i = 2;
345     args[2].i = -3;
346     args[3].i = 4;
347     args[4].i = -5;
348     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
349     EXPECT_EQ(-3, result.GetI());
350 
351     args[0].i = INT_MAX;
352     args[1].i = INT_MIN;
353     args[2].i = INT_MAX;
354     args[3].i = INT_MIN;
355     args[4].i = INT_MAX;
356     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
357     EXPECT_EQ(2147483645, result.GetI());
358 
359     args[0].i = INT_MAX;
360     args[1].i = INT_MAX;
361     args[2].i = INT_MAX;
362     args[3].i = INT_MAX;
363     args[4].i = INT_MAX;
364     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
365     EXPECT_EQ(2147483643, result.GetI());
366   }
367 
InvokeSumDoubleDoubleMethod(bool is_static)368   void InvokeSumDoubleDoubleMethod(bool is_static) {
369     ScopedObjectAccess soa(env_);
370     mirror::ArtMethod* method;
371     mirror::Object* receiver;
372     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DD)D");
373     jvalue args[2];
374 
375     args[0].d = 0.0;
376     args[1].d = 0.0;
377     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
378     EXPECT_EQ(0.0, result.GetD());
379 
380     args[0].d = 1.0;
381     args[1].d = 2.0;
382     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
383     EXPECT_EQ(3.0, result.GetD());
384 
385     args[0].d = 1.0;
386     args[1].d = -2.0;
387     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
388     EXPECT_EQ(-1.0, result.GetD());
389 
390     args[0].d = DBL_MAX;
391     args[1].d = DBL_MIN;
392     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
393     EXPECT_EQ(1.7976931348623157e308, result.GetD());
394 
395     args[0].d = DBL_MAX;
396     args[1].d = DBL_MAX;
397     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
398     EXPECT_EQ(INFINITY, result.GetD());
399   }
400 
InvokeSumDoubleDoubleDoubleMethod(bool is_static)401   void InvokeSumDoubleDoubleDoubleMethod(bool is_static) {
402     ScopedObjectAccess soa(env_);
403     mirror::ArtMethod* method;
404     mirror::Object* receiver;
405     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDD)D");
406     jvalue args[3];
407 
408     args[0].d = 0.0;
409     args[1].d = 0.0;
410     args[2].d = 0.0;
411     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
412     EXPECT_EQ(0.0, result.GetD());
413 
414     args[0].d = 1.0;
415     args[1].d = 2.0;
416     args[2].d = 3.0;
417     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
418     EXPECT_EQ(6.0, result.GetD());
419 
420     args[0].d = 1.0;
421     args[1].d = -2.0;
422     args[2].d = 3.0;
423     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
424     EXPECT_EQ(2.0, result.GetD());
425   }
426 
InvokeSumDoubleDoubleDoubleDoubleMethod(bool is_static)427   void InvokeSumDoubleDoubleDoubleDoubleMethod(bool is_static) {
428     ScopedObjectAccess soa(env_);
429     mirror::ArtMethod* method;
430     mirror::Object* receiver;
431     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDDD)D");
432     jvalue args[4];
433 
434     args[0].d = 0.0;
435     args[1].d = 0.0;
436     args[2].d = 0.0;
437     args[3].d = 0.0;
438     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
439     EXPECT_EQ(0.0, result.GetD());
440 
441     args[0].d = 1.0;
442     args[1].d = 2.0;
443     args[2].d = 3.0;
444     args[3].d = 4.0;
445     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
446     EXPECT_EQ(10.0, result.GetD());
447 
448     args[0].d = 1.0;
449     args[1].d = -2.0;
450     args[2].d = 3.0;
451     args[3].d = -4.0;
452     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
453     EXPECT_EQ(-2.0, result.GetD());
454   }
455 
InvokeSumDoubleDoubleDoubleDoubleDoubleMethod(bool is_static)456   void InvokeSumDoubleDoubleDoubleDoubleDoubleMethod(bool is_static) {
457     ScopedObjectAccess soa(env_);
458     mirror::ArtMethod* method;
459     mirror::Object* receiver;
460     ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDDDD)D");
461     jvalue args[5];
462 
463     args[0].d = 0.0;
464     args[1].d = 0.0;
465     args[2].d = 0.0;
466     args[3].d = 0.0;
467     args[4].d = 0.0;
468     JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
469     EXPECT_EQ(0.0, result.GetD());
470 
471     args[0].d = 1.0;
472     args[1].d = 2.0;
473     args[2].d = 3.0;
474     args[3].d = 4.0;
475     args[4].d = 5.0;
476     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
477     EXPECT_EQ(15.0, result.GetD());
478 
479     args[0].d = 1.0;
480     args[1].d = -2.0;
481     args[2].d = 3.0;
482     args[3].d = -4.0;
483     args[4].d = 5.0;
484     result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args);
485     EXPECT_EQ(3.0, result.GetD());
486   }
487 
488   JavaVMExt* vm_;
489   JNIEnv* env_;
490   jclass aioobe_;
491   jclass ase_;
492   jclass sioobe_;
493 };
494 
TEST_F(ReflectionTest,StaticMainMethod)495 TEST_F(ReflectionTest, StaticMainMethod) {
496   TEST_DISABLED_FOR_PORTABLE();
497   ScopedObjectAccess soa(Thread::Current());
498   jobject jclass_loader = LoadDex("Main");
499   StackHandleScope<1> hs(soa.Self());
500   Handle<mirror::ClassLoader> class_loader(
501       hs.NewHandle(soa.Decode<mirror::ClassLoader*>(jclass_loader)));
502   CompileDirectMethod(class_loader, "Main", "main", "([Ljava/lang/String;)V");
503 
504   mirror::Class* klass = class_linker_->FindClass(soa.Self(), "LMain;", class_loader);
505   ASSERT_TRUE(klass != NULL);
506 
507   mirror::ArtMethod* method = klass->FindDirectMethod("main", "([Ljava/lang/String;)V");
508   ASSERT_TRUE(method != NULL);
509 
510   // Start runtime.
511   bool started = runtime_->Start();
512   CHECK(started);
513   soa.Self()->TransitionFromSuspendedToRunnable();
514 
515   jvalue args[1];
516   args[0].l = nullptr;
517   InvokeWithJValues(soa, nullptr, soa.EncodeMethod(method), args);
518 }
519 
TEST_F(ReflectionTest,StaticNopMethod)520 TEST_F(ReflectionTest, StaticNopMethod) {
521   TEST_DISABLED_FOR_PORTABLE();
522   InvokeNopMethod(true);
523 }
524 
TEST_F(ReflectionTest,NonStaticNopMethod)525 TEST_F(ReflectionTest, NonStaticNopMethod) {
526   TEST_DISABLED_FOR_PORTABLE();
527   InvokeNopMethod(false);
528 }
529 
TEST_F(ReflectionTest,StaticIdentityByteMethod)530 TEST_F(ReflectionTest, StaticIdentityByteMethod) {
531   TEST_DISABLED_FOR_PORTABLE();
532   InvokeIdentityByteMethod(true);
533 }
534 
TEST_F(ReflectionTest,NonStaticIdentityByteMethod)535 TEST_F(ReflectionTest, NonStaticIdentityByteMethod) {
536   TEST_DISABLED_FOR_PORTABLE();
537   InvokeIdentityByteMethod(false);
538 }
539 
TEST_F(ReflectionTest,StaticIdentityIntMethod)540 TEST_F(ReflectionTest, StaticIdentityIntMethod) {
541   TEST_DISABLED_FOR_PORTABLE();
542   InvokeIdentityIntMethod(true);
543 }
544 
TEST_F(ReflectionTest,NonStaticIdentityIntMethod)545 TEST_F(ReflectionTest, NonStaticIdentityIntMethod) {
546   TEST_DISABLED_FOR_PORTABLE();
547   InvokeIdentityIntMethod(false);
548 }
549 
TEST_F(ReflectionTest,StaticIdentityDoubleMethod)550 TEST_F(ReflectionTest, StaticIdentityDoubleMethod) {
551   TEST_DISABLED_FOR_PORTABLE();
552   InvokeIdentityDoubleMethod(true);
553 }
554 
TEST_F(ReflectionTest,NonStaticIdentityDoubleMethod)555 TEST_F(ReflectionTest, NonStaticIdentityDoubleMethod) {
556   TEST_DISABLED_FOR_PORTABLE();
557   InvokeIdentityDoubleMethod(false);
558 }
559 
TEST_F(ReflectionTest,StaticSumIntIntMethod)560 TEST_F(ReflectionTest, StaticSumIntIntMethod) {
561   TEST_DISABLED_FOR_PORTABLE();
562   InvokeSumIntIntMethod(true);
563 }
564 
TEST_F(ReflectionTest,NonStaticSumIntIntMethod)565 TEST_F(ReflectionTest, NonStaticSumIntIntMethod) {
566   TEST_DISABLED_FOR_PORTABLE();
567   InvokeSumIntIntMethod(false);
568 }
569 
TEST_F(ReflectionTest,StaticSumIntIntIntMethod)570 TEST_F(ReflectionTest, StaticSumIntIntIntMethod) {
571   TEST_DISABLED_FOR_PORTABLE();
572   InvokeSumIntIntIntMethod(true);
573 }
574 
TEST_F(ReflectionTest,NonStaticSumIntIntIntMethod)575 TEST_F(ReflectionTest, NonStaticSumIntIntIntMethod) {
576   TEST_DISABLED_FOR_PORTABLE();
577   InvokeSumIntIntIntMethod(false);
578 }
579 
TEST_F(ReflectionTest,StaticSumIntIntIntIntMethod)580 TEST_F(ReflectionTest, StaticSumIntIntIntIntMethod) {
581   TEST_DISABLED_FOR_PORTABLE();
582   InvokeSumIntIntIntIntMethod(true);
583 }
584 
TEST_F(ReflectionTest,NonStaticSumIntIntIntIntMethod)585 TEST_F(ReflectionTest, NonStaticSumIntIntIntIntMethod) {
586   TEST_DISABLED_FOR_PORTABLE();
587   InvokeSumIntIntIntIntMethod(false);
588 }
589 
TEST_F(ReflectionTest,StaticSumIntIntIntIntIntMethod)590 TEST_F(ReflectionTest, StaticSumIntIntIntIntIntMethod) {
591   TEST_DISABLED_FOR_PORTABLE();
592   InvokeSumIntIntIntIntIntMethod(true);
593 }
594 
TEST_F(ReflectionTest,NonStaticSumIntIntIntIntIntMethod)595 TEST_F(ReflectionTest, NonStaticSumIntIntIntIntIntMethod) {
596   TEST_DISABLED_FOR_PORTABLE();
597   InvokeSumIntIntIntIntIntMethod(false);
598 }
599 
TEST_F(ReflectionTest,StaticSumDoubleDoubleMethod)600 TEST_F(ReflectionTest, StaticSumDoubleDoubleMethod) {
601   TEST_DISABLED_FOR_PORTABLE();
602   InvokeSumDoubleDoubleMethod(true);
603 }
604 
TEST_F(ReflectionTest,NonStaticSumDoubleDoubleMethod)605 TEST_F(ReflectionTest, NonStaticSumDoubleDoubleMethod) {
606   TEST_DISABLED_FOR_PORTABLE();
607   InvokeSumDoubleDoubleMethod(false);
608 }
609 
TEST_F(ReflectionTest,StaticSumDoubleDoubleDoubleMethod)610 TEST_F(ReflectionTest, StaticSumDoubleDoubleDoubleMethod) {
611   TEST_DISABLED_FOR_PORTABLE();
612   InvokeSumDoubleDoubleDoubleMethod(true);
613 }
614 
TEST_F(ReflectionTest,NonStaticSumDoubleDoubleDoubleMethod)615 TEST_F(ReflectionTest, NonStaticSumDoubleDoubleDoubleMethod) {
616   TEST_DISABLED_FOR_PORTABLE();
617   InvokeSumDoubleDoubleDoubleMethod(false);
618 }
619 
TEST_F(ReflectionTest,StaticSumDoubleDoubleDoubleDoubleMethod)620 TEST_F(ReflectionTest, StaticSumDoubleDoubleDoubleDoubleMethod) {
621   TEST_DISABLED_FOR_PORTABLE();
622   InvokeSumDoubleDoubleDoubleDoubleMethod(true);
623 }
624 
TEST_F(ReflectionTest,NonStaticSumDoubleDoubleDoubleDoubleMethod)625 TEST_F(ReflectionTest, NonStaticSumDoubleDoubleDoubleDoubleMethod) {
626   TEST_DISABLED_FOR_PORTABLE();
627   InvokeSumDoubleDoubleDoubleDoubleMethod(false);
628 }
629 
TEST_F(ReflectionTest,StaticSumDoubleDoubleDoubleDoubleDoubleMethod)630 TEST_F(ReflectionTest, StaticSumDoubleDoubleDoubleDoubleDoubleMethod) {
631   TEST_DISABLED_FOR_PORTABLE();
632   InvokeSumDoubleDoubleDoubleDoubleDoubleMethod(true);
633 }
634 
TEST_F(ReflectionTest,NonStaticSumDoubleDoubleDoubleDoubleDoubleMethod)635 TEST_F(ReflectionTest, NonStaticSumDoubleDoubleDoubleDoubleDoubleMethod) {
636   TEST_DISABLED_FOR_PORTABLE();
637   InvokeSumDoubleDoubleDoubleDoubleDoubleMethod(false);
638 }
639 
640 }  // namespace art
641