diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-03 02:03:34 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-03 02:03:34 +0200 |
commit | 6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b (patch) | |
tree | f7e836e456c12c48497dfa918dd69272842d3c20 /tests/manual | |
parent | Merge "Do not skip the update installation if it's a retry" (diff) | |
parent | tests: Pick up testdata with LOCAL_TEST_DATA. (diff) | |
download | android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.tar android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.tar.gz android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.tar.bz2 android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.tar.lz android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.tar.xz android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.tar.zst android_bootable_recovery-6b6c21af2873ebd8a3e79ed1c853ca4e0ce9e88b.zip |
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/recovery_test.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/manual/recovery_test.cpp b/tests/manual/recovery_test.cpp index 64e3b59e6..224ed5b68 100644 --- a/tests/manual/recovery_test.cpp +++ b/tests/manual/recovery_test.cpp @@ -34,7 +34,6 @@ static const std::string myFilename = "/data/misc/recovery/inject.txt"; static const std::string myContent = "Hello World\nWelcome to my recovery\n"; static const std::string kLocale = "zu"; -static const std::string kResourceTestDir = "/data/nativetest/recovery/"; // Failure is expected on systems that do not deliver either the // recovery-persist or recovery-refresh executables. Tests also require @@ -108,19 +107,20 @@ static int png_filter(const dirent* de) { return 1; } -// Find out all png files to test under /data/nativetest/recovery/. +// Find out all the PNG files to test, which stay under the same dir with the executable. static std::vector<std::string> add_files() { + std::string exec_dir = android::base::GetExecutableDirectory(); std::vector<std::string> files; - for (const std::string& str : image_dir) { - std::string dir_path = kResourceTestDir + str; + for (const std::string& image : image_dir) { + std::string dir_path = exec_dir + "/" + image; dirent** namelist; int n = scandir(dir_path.c_str(), &namelist, png_filter, alphasort); if (n == -1) { - printf("Failed to scan dir %s: %s\n", kResourceTestDir.c_str(), strerror(errno)); + printf("Failed to scan dir %s: %s\n", exec_dir.c_str(), strerror(errno)); return files; } if (n == 0) { - printf("No file is added for test in %s\n", kResourceTestDir.c_str()); + printf("No file is added for test in %s\n", exec_dir.c_str()); } while (n--) { |