From 96e83930f35544872228be209d3704f60c2c485c Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Wed, 29 Oct 2014 19:45:42 -0700 Subject: 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 --- test/117-nopatchoat/src/Main.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/117-nopatchoat/src') 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(); -- cgit v1.1