summaryrefslogtreecommitdiffstats
path: root/test/117-nopatchoat/src
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2014-10-29 19:45:42 -0700
committerIgor Murashkin <iam@google.com>2014-10-30 13:29:31 -0700
commit96e83930f35544872228be209d3704f60c2c485c (patch)
tree046d24ed5c43fdbdb4293f1ca23105a5cc71039b /test/117-nopatchoat/src
parent0ea536897c078761e0309437a3d25fbbf53c94a3 (diff)
downloadart-96e83930f35544872228be209d3704f60c2c485c.zip
art-96e83930f35544872228be209d3704f60c2c485c.tar.gz
art-96e83930f35544872228be209d3704f60c2c485c.tar.bz2
art: Fix classlinker and nopatchoat test for PIC case
ClassLinker should not be checking oat data begin and the patch delta as part of the checksum verification (when PIC is enabled). Also update nopatchoat test since it needs to be parametric on whether PIC is used. Bug: 18035729 Change-Id: I4eb184d22616230a7b8f0dd514d3416d0976b07e
Diffstat (limited to 'test/117-nopatchoat/src')
-rw-r--r--test/117-nopatchoat/src/Main.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/117-nopatchoat/src/Main.java b/test/117-nopatchoat/src/Main.java
index f3f91ce..7bc9dbb 100644
--- a/test/117-nopatchoat/src/Main.java
+++ b/test/117-nopatchoat/src/Main.java
@@ -16,9 +16,14 @@
public class Main {
public static void main(String[] args) {
+ boolean executable_correct = (isPic() ?
+ hasExecutableOat() == true :
+ hasExecutableOat() == isDex2OatEnabled());
+
System.out.println(
"dex2oat & patchoat are " + ((isDex2OatEnabled()) ? "enabled" : "disabled") +
- ", has oat is " + hasOat() + ", has executable oat is " + hasExecutableOat() + ".");
+ ", has oat is " + hasOat() + ", has executable oat is " + (
+ executable_correct ? "expected" : "not expected") + ".");
if (!hasOat() && isDex2OatEnabled()) {
throw new Error("Application with dex2oat enabled runs without an oat file");
@@ -42,6 +47,8 @@ public class Main {
private native static boolean isDex2OatEnabled();
+ private native static boolean isPic();
+
private native static boolean hasOat();
private native static boolean hasExecutableOat();