summaryrefslogtreecommitdiff
path: root/patchoat/patchoat_test.cc
diff options
context:
space:
mode:
author Chris Morin <cmtm@google.com> 2018-02-13 15:26:21 -0800
committer Christopher Morin <cmtm@google.com> 2018-02-20 16:35:18 +0000
commit88c6d26dd8686bdb366d54937a505f10f3bf1cd8 (patch)
tree2f07c4ef2144c4a909760260389d070fe22af05e /patchoat/patchoat_test.cc
parent38321bb87c3630afaef76f312e90df5bca6a0554 (diff)
patchoat: take directories instead of filenames
patchoat was already ignoring the basename part of the filename passed to it for both --output-image-file and --output-image-relocation-file. We can therefore just pass in the directories instead. Bug: 72828459 Test: make test-art-host-gtest-patchoat_test Change-Id: I1a699d1f6746f068078ae768d30690431578d84e
Diffstat (limited to 'patchoat/patchoat_test.cc')
-rw-r--r--patchoat/patchoat_test.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/patchoat/patchoat_test.cc b/patchoat/patchoat_test.cc
index 69c6bfae30..ac3abd0642 100644
--- a/patchoat/patchoat_test.cc
+++ b/patchoat/patchoat_test.cc
@@ -137,32 +137,32 @@ class PatchoatTest : public DexoptTest {
}
bool RelocateBootImage(const std::string& input_image_location,
- const std::string& output_image_filename,
+ const std::string& output_image_directory,
off_t base_offset_delta,
std::string* error_msg) {
std::vector<std::string> argv = BasePatchoatCommand(input_image_location, base_offset_delta);
- argv.push_back("--output-image-file=" + output_image_filename);
+ argv.push_back("--output-image-directory=" + output_image_directory);
return RunDex2OatOrPatchoat(argv, error_msg);
}
bool VerifyBootImage(const std::string& input_image_location,
- const std::string& output_image_filename,
+ const std::string& output_image_directory,
off_t base_offset_delta,
std::string* error_msg) {
std::vector<std::string> argv = BasePatchoatCommand(input_image_location, base_offset_delta);
- argv.push_back("--output-image-file=" + output_image_filename);
+ argv.push_back("--output-image-directory=" + output_image_directory);
argv.push_back("--verify");
return RunDex2OatOrPatchoat(argv, error_msg);
}
bool GenerateBootImageRelFile(const std::string& input_image_location,
- const std::string& output_rel_filename,
+ const std::string& output_rel_directory,
off_t base_offset_delta,
std::string* error_msg) {
std::vector<std::string> argv = BasePatchoatCommand(input_image_location, base_offset_delta);
- argv.push_back("--output-image-relocation-file=" + output_rel_filename);
+ argv.push_back("--output-image-relocation-directory=" + output_rel_directory);
return RunDex2OatOrPatchoat(argv, error_msg);
}
@@ -375,7 +375,7 @@ TEST_F(PatchoatTest, PatchoatRelocationSameAsDex2oatRelocation) {
ASSERT_EQ(0, symlink(dex2oat_orig_dir.c_str(), dex2oat_orig_with_arch_dir.c_str()));
if (!RelocateBootImage(
dex2oat_orig_dir + "/boot.art",
- patchoat_dir + "/boot.art",
+ patchoat_dir,
base_addr_delta,
&error_msg)) {
FAIL() << "RelocateBootImage failed: " << error_msg;
@@ -467,7 +467,7 @@ TEST_F(PatchoatTest, RelFileVerification) {
off_t base_addr_delta = 0x100000;
if (!GenerateBootImageRelFile(
dex2oat_orig_dir + "/boot.art",
- dex2oat_orig_dir + "/boot.art.rel",
+ dex2oat_orig_dir,
base_addr_delta,
&error_msg)) {
FAIL() << "RelocateBootImage failed: " << error_msg;
@@ -483,7 +483,7 @@ TEST_F(PatchoatTest, RelFileVerification) {
base_addr_delta -= 0x10000;
if (!RelocateBootImage(
dex2oat_orig_dir + "/boot.art",
- relocated_dir + "/boot.art",
+ relocated_dir,
base_addr_delta,
&error_msg)) {
FAIL() << "RelocateBootImage failed: " << error_msg;
@@ -524,7 +524,7 @@ TEST_F(PatchoatTest, RelFileVerification) {
// Assert that verification works with the .rel files.
if (!VerifyBootImage(
dex2oat_orig_dir + "/boot.art",
- relocated_dir + "/boot.art",
+ relocated_dir,
base_addr_delta,
&error_msg)) {
FAIL() << "VerifyBootImage failed: " << error_msg;