diff options
author | 2018-05-21 14:17:59 +0100 | |
---|---|---|
committer | 2018-05-21 14:22:28 +0100 | |
commit | e64d58c983fd44af319e2a5140f02b7ecbfccd91 (patch) | |
tree | 5fe9b46d815c7f4d41600b744a973e03db5ca8fc | |
parent | e937c045a50b414411db058d32d8f689fb596e2e (diff) |
Fix typo that leads to crash.
Typo got introduced in:
https://android-review.googlesource.com/#/c/platform/art/+/682841/
bug: 80004139
Test: 677-fsi2
Change-Id: I2744257afd49ee069d87b2637c1cd3427ca61927
-rw-r--r-- | libartbase/base/file_utils.cc | 3 | ||||
-rw-r--r-- | test/677-fsi2/expected.txt | 4 | ||||
-rw-r--r-- | test/677-fsi2/info.txt | 1 | ||||
-rw-r--r-- | test/677-fsi2/run | 25 | ||||
-rw-r--r-- | test/677-fsi2/src/Main.java | 21 |
5 files changed, 53 insertions, 1 deletions
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc index 9450e1e8c1..56934aca1f 100644 --- a/libartbase/base/file_utils.cc +++ b/libartbase/base/file_utils.cc @@ -264,7 +264,8 @@ std::string ReplaceFileExtension(const std::string& filename, const std::string& bool LocationIsOnSystem(const char* path) { UniqueCPtr<const char[]> full_path(realpath(path, nullptr)); - return path != nullptr && android::base::StartsWith(full_path.get(), GetAndroidRoot().c_str()); + return full_path != nullptr && + android::base::StartsWith(full_path.get(), GetAndroidRoot().c_str()); } bool LocationIsOnSystemFramework(const char* full_path) { diff --git a/test/677-fsi2/expected.txt b/test/677-fsi2/expected.txt new file mode 100644 index 0000000000..de008470fe --- /dev/null +++ b/test/677-fsi2/expected.txt @@ -0,0 +1,4 @@ +Run default +Hello World +Run without dex2oat +Hello World diff --git a/test/677-fsi2/info.txt b/test/677-fsi2/info.txt new file mode 100644 index 0000000000..ed0a0f2388 --- /dev/null +++ b/test/677-fsi2/info.txt @@ -0,0 +1 @@ +Test that -Xonly-use-system-oat-files works. diff --git a/test/677-fsi2/run b/test/677-fsi2/run new file mode 100644 index 0000000000..039a6a78f0 --- /dev/null +++ b/test/677-fsi2/run @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "Run default" +${RUN} $@ --runtime-option -Xonly-use-system-oat-files +return_status1=$? + +echo "Run without dex2oat" +${RUN} $@ --no-dex2oat --runtime-option -Xonly-use-system-oat-files +return_status2=$? + +(exit $return_status1) && (exit $return_status2) diff --git a/test/677-fsi2/src/Main.java b/test/677-fsi2/src/Main.java new file mode 100644 index 0000000000..834075f67a --- /dev/null +++ b/test/677-fsi2/src/Main.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class Main { + public static void main(String[] args) { + System.out.println("Hello World"); + } +} |