summaryrefslogtreecommitdiff
path: root/oatdump/oatdump_app_test.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-07-18 14:17:47 -0700
committer Mathieu Chartier <mathieuc@google.com> 2019-07-19 15:46:56 +0000
commit6b689ceb63b4fffaf0e617f7d363c841dd29e458 (patch)
tree0e8b554f3cc6390435c7caa05b378c47e9079be3 /oatdump/oatdump_app_test.cc
parentd84794d235df588814533d96f6e459b72f3a19b1 (diff)
Fix handling for invalid or missing app images
Avoid crashing when there is an invalid app image path passed to oatdump. Added regression test. Bug: 137724009 Test: test-art-host-gtest-oatdump_app_test Change-Id: I27470d0c1d844de5b9f3f3bf960e925cd8977d50
Diffstat (limited to 'oatdump/oatdump_app_test.cc')
-rw-r--r--oatdump/oatdump_app_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/oatdump/oatdump_app_test.cc b/oatdump/oatdump_app_test.cc
index 4490647d2c..b4997ba8db 100644
--- a/oatdump/oatdump_app_test.cc
+++ b/oatdump/oatdump_app_test.cc
@@ -42,4 +42,13 @@ TEST_F(OatDumpTest, TestAppImageWithBootImageStatic) {
ASSERT_TRUE(Exec(kStatic, kModeAppImage, {}, kListAndCode));
}
+TEST_F(OatDumpTest, TestAppImageInvalidPath) {
+ TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867
+ TEST_DISABLED_FOR_NON_STATIC_HOST_BUILDS();
+ const std::string app_image_arg = "--app-image-file=" + GetAppImageName();
+ ASSERT_TRUE(GenerateAppOdexFile(kStatic, {"--runtime-arg", "-Xmx64M", app_image_arg}));
+ SetAppImageName("missing_app_image.art");
+ ASSERT_TRUE(Exec(kStatic, kModeAppImage, {}, kListAndCode, /*expect_failure=*/true));
+}
+
} // namespace art