Merge "ART: Fix test 117 after OatFileAssistant change"
diff --git a/test/117-nopatchoat/nopatchoat.cc b/test/117-nopatchoat/nopatchoat.cc
index 1337442..82e1fc8 100644
--- a/test/117-nopatchoat/nopatchoat.cc
+++ b/test/117-nopatchoat/nopatchoat.cc
@@ -46,7 +46,7 @@
return oat_dex_file != nullptr && oat_dex_file->GetOatFile()->IsExecutable();
}
- static bool isPic(jclass cls) {
+ static bool needsRelocation(jclass cls) {
const OatFile::OatDexFile* oat_dex_file = getOatDexFile(cls);
if (oat_dex_file == nullptr) {
@@ -54,7 +54,7 @@
}
const OatFile* oat_file = oat_dex_file->GetOatFile();
- return oat_file->IsPic();
+ return !oat_file->IsPic() && !oat_file->IsExtractOnly();
}
};
@@ -66,8 +66,8 @@
return NoPatchoatTest::hasExecutableOat(cls);
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isPic(JNIEnv*, jclass cls) {
- return NoPatchoatTest::isPic(cls);
+extern "C" JNIEXPORT jboolean JNICALL Java_Main_needsRelocation(JNIEnv*, jclass cls) {
+ return NoPatchoatTest::needsRelocation(cls);
}
} // namespace art
diff --git a/test/117-nopatchoat/src/Main.java b/test/117-nopatchoat/src/Main.java
index 425cf48..816eb17 100644
--- a/test/117-nopatchoat/src/Main.java
+++ b/test/117-nopatchoat/src/Main.java
@@ -22,9 +22,9 @@
// ANDROID_DATA has been relocated, since a non-relocated oat file always has a 0 delta.
// Hitting this condition should be rare and ideally we would prevent it from happening but
// there is no way to do so without major changes to the run-test framework.
- boolean executable_correct = (isPic() ?
- hasExecutableOat() == true :
- hasExecutableOat() == (isDex2OatEnabled() || isRelocationDeltaZero()));
+ boolean executable_correct = (needsRelocation() ?
+ hasExecutableOat() == (isDex2OatEnabled() || isRelocationDeltaZero()) :
+ hasExecutableOat() == true);
System.out.println(
"dex2oat & patchoat are " + ((isDex2OatEnabled()) ? "enabled" : "disabled") +
@@ -49,7 +49,7 @@
private native static boolean isDex2OatEnabled();
- private native static boolean isPic();
+ private native static boolean needsRelocation();
private native static boolean hasOatFile();