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
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index 685e1e2..4d40418 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -119,12 +119,12 @@
}
}
-// 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 @@
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_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 @@
// 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).
diff --git a/dex2oat/linker/relative_patcher_test.h b/dex2oat/linker/relative_patcher_test.h
index f34e6eb..1971e5a 100644
--- a/dex2oat/linker/relative_patcher_test.h
+++ b/dex2oat/linker/relative_patcher_test.h
@@ -145,15 +145,15 @@
// Write data.
DCHECK(output_.empty());
- uint8_t dummy_trampoline[kTrampolineSize];
- memset(dummy_trampoline, 0, sizeof(dummy_trampoline));
- out_->WriteFully(dummy_trampoline, kTrampolineSize);
+ uint8_t fake_trampoline[kTrampolineSize];
+ memset(fake_trampoline, 0, sizeof(fake_trampoline));
+ out_->WriteFully(fake_trampoline, kTrampolineSize);
offset = kTrampolineSize;
static const uint8_t kPadding[] = {
0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u
};
- uint8_t dummy_header[sizeof(OatQuickMethodHeader)];
- memset(dummy_header, 0, sizeof(dummy_header));
+ uint8_t fake_header[sizeof(OatQuickMethodHeader)];
+ memset(fake_header, 0, sizeof(fake_header));
for (auto& compiled_method : compiled_methods_) {
offset = patcher_->WriteThunks(out_.get(), offset);
@@ -162,7 +162,7 @@
out_->WriteFully(kPadding, alignment_size);
offset += alignment_size;
- out_->WriteFully(dummy_header, sizeof(OatQuickMethodHeader));
+ out_->WriteFully(fake_header, sizeof(OatQuickMethodHeader));
offset += sizeof(OatQuickMethodHeader);
ArrayRef<const uint8_t> code = compiled_method->GetQuickCode();
if (!compiled_method->GetPatches().empty()) {
diff --git a/libdexfile/dex/string_reference_test.cc b/libdexfile/dex/string_reference_test.cc
index b9cbf48..6c10f22 100644
--- a/libdexfile/dex/string_reference_test.cc
+++ b/libdexfile/dex/string_reference_test.cc
@@ -33,14 +33,14 @@
// that it's the wrong string. Without the fix the strings would then compare equal.
TestDexFileBuilder builder1;
builder1.AddString("String1");
- std::unique_ptr<const DexFile> dex_file1 = builder1.Build("dummy location 1");
+ std::unique_ptr<const DexFile> dex_file1 = builder1.Build("fake location 1");
ASSERT_EQ(1u, dex_file1->NumStringIds());
ASSERT_STREQ("String1", dex_file1->GetStringData(dex_file1->GetStringId(dex::StringIndex(0))));
StringReference sr1(dex_file1.get(), dex::StringIndex(0));
TestDexFileBuilder builder2;
builder2.AddString("String2");
- std::unique_ptr<const DexFile> dex_file2 = builder2.Build("dummy location 2");
+ std::unique_ptr<const DexFile> dex_file2 = builder2.Build("fake location 2");
ASSERT_EQ(1u, dex_file2->NumStringIds());
ASSERT_STREQ("String2", dex_file2->GetStringData(dex_file2->GetStringId(dex::StringIndex(0))));
StringReference sr2(dex_file2.get(), dex::StringIndex(0));
@@ -78,7 +78,7 @@
for (const char* s : kDexFile1Strings) {
builder1.AddString(s);
}
- std::unique_ptr<const DexFile> dex_file1 = builder1.Build("dummy location 1");
+ std::unique_ptr<const DexFile> dex_file1 = builder1.Build("fake location 1");
ASSERT_EQ(arraysize(kDexFile1Strings), dex_file1->NumStringIds());
for (size_t index = 0; index != arraysize(kDexFile1Strings); ++index) {
ASSERT_STREQ(kDexFile1Strings[index],
@@ -89,7 +89,7 @@
for (const char* s : kDexFile2Strings) {
builder2.AddString(s);
}
- std::unique_ptr<const DexFile> dex_file2 = builder2.Build("dummy location 1");
+ std::unique_ptr<const DexFile> dex_file2 = builder2.Build("fake location 1");
ASSERT_EQ(arraysize(kDexFile2Strings), dex_file2->NumStringIds());
for (size_t index = 0; index != arraysize(kDexFile2Strings); ++index) {
ASSERT_STREQ(kDexFile2Strings[index],
diff --git a/test/004-JniTest/jni_test.cc b/test/004-JniTest/jni_test.cc
index 540e6ce..65da24e 100644
--- a/test/004-JniTest/jni_test.cc
+++ b/test/004-JniTest/jni_test.cc
@@ -801,11 +801,11 @@
extern "C" JNIEXPORT jboolean JNICALL Java_Main_isSlowDebug(JNIEnv*, jclass) {
// Return whether slow-debug is on. Only relevant for debug builds.
if (kIsDebugBuild) {
- // Register a dummy flag and get the default value it should be initialized with.
- static bool dummy_flag = false;
- dummy_flag = RegisterRuntimeDebugFlag(&dummy_flag);
+ // Register a fake flag and get the default value it should be initialized with.
+ static bool fake_flag = false;
+ fake_flag = RegisterRuntimeDebugFlag(&fake_flag);
- return dummy_flag ? JNI_TRUE : JNI_FALSE;
+ return fake_flag ? JNI_TRUE : JNI_FALSE;
}
// To pass the Java-side test, just so "on" for release builds.
return JNI_TRUE;