diff options
author | 2020-07-23 11:04:39 +0000 | |
---|---|---|
committer | 2020-07-23 14:15:33 +0000 | |
commit | c2208272f24e921b808af53721d2ca821d76503c (patch) | |
tree | 924a1ca0e42c8a59947c4c86e5d26ac4f9d8d71b /compiler | |
parent | 50a454b23485ceb8fe37e102abc0e41e2857876a (diff) |
Replace "dummy" with "fake" in some tests.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing -t 004-JniTest
Bug: 161336379
Change-Id: Ifab653fbf66af8ea3bd4a35ca116c7cc91be51bd
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/jni/jni_compiler_test.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc index 685e1e287b..4d40418f6c 100644 --- a/compiler/jni/jni_compiler_test.cc +++ b/compiler/jni/jni_compiler_test.cc @@ -119,12 +119,12 @@ static std::string CurrentJniStringSuffix() { } } -// Dummy values passed to our JNI handlers when we enter @CriticalNative. +// Fake values passed to our JNI handlers when we enter @CriticalNative. // Normally @CriticalNative calling convention strips out the "JNIEnv*, jclass" parameters. // However to avoid duplicating every single test method we have a templated handler -// that inserts dummy parameters (0,1) to make it compatible with a regular JNI handler. -static JNIEnv* const kCriticalDummyJniEnv = reinterpret_cast<JNIEnv*>(0xDEADFEAD); -static jclass const kCriticalDummyJniClass = reinterpret_cast<jclass>(0xBEAFBEEF); +// that inserts fake parameters (0,1) to make it compatible with a regular JNI handler. +static JNIEnv* const kCriticalFakeJniEnv = reinterpret_cast<JNIEnv*>(0xDEADFEAD); +static jclass const kCriticalFakeJniClass = reinterpret_cast<jclass>(0xBEAFBEEF); // Type trait. Returns true if "T" is the same type as one of the types in Args... // @@ -212,8 +212,8 @@ template <typename R, typename Arg1, typename Arg2, typename ... Args, R (*fn)(A struct remove_extra_parameters_helper<R(Arg1, Arg2, Args...), fn> { // Note: Do not use Args&& here to maintain C-style parameter types. static R apply(Args... args) { - JNIEnv* env = kCriticalDummyJniEnv; - jclass kls = kCriticalDummyJniClass; + JNIEnv* env = kCriticalFakeJniEnv; + jclass kls = kCriticalFakeJniClass; return fn(env, kls, args...); } }; @@ -502,8 +502,8 @@ static void expectValidJniEnvAndClass(JNIEnv* env, jclass kls) { static_cast<jobject>(kls))); } else { // This is pretty much vacuously true but catch any testing setup mistakes. - EXPECT_EQ(env, kCriticalDummyJniEnv); - EXPECT_EQ(kls, kCriticalDummyJniClass); + EXPECT_EQ(env, kCriticalFakeJniEnv); + EXPECT_EQ(kls, kCriticalFakeJniClass); } } @@ -511,7 +511,7 @@ static void expectValidJniEnvAndClass(JNIEnv* env, jclass kls) { // that the jclass we got in the JNI handler is the same one as the class the method was looked // up for. // -// (Checks are skipped for @CriticalNative since the two values are dummy). +// (Checks are skipped for @CriticalNative since the two values are fake). #define EXPECT_JNI_ENV_AND_CLASS_FOR_CURRENT_JNI(env, kls) expectValidJniEnvAndClass(env, kls) // Temporarily disable the EXPECT_NUM_STACK_REFERENCES check (for a single test). |