summaryrefslogtreecommitdiffstats
path: root/tests/common/test_constants.h
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-11-02 09:04:35 +0100
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-11-02 09:04:35 +0100
commitb5e74f569bed8eb8e660ac38fec6d65aa902a17c (patch)
treefa8381b588d465ac28be58aa61efadafbc0cbb83 /tests/common/test_constants.h
parentSnap for 4425573 from 1385908bdbe37a1c3fc58c89de8d24fb0b5b3089 to pi-release (diff)
parentupdate_verifier: Fix the wrong computation with group_range_count. am: 559a6d1d2a (diff)
downloadandroid_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.tar
android_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.tar.gz
android_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.tar.bz2
android_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.tar.lz
android_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.tar.xz
android_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.tar.zst
android_bootable_recovery-b5e74f569bed8eb8e660ac38fec6d65aa902a17c.zip
Diffstat (limited to 'tests/common/test_constants.h')
-rw-r--r--tests/common/test_constants.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/common/test_constants.h b/tests/common/test_constants.h
index f6b6922a4..514818e0a 100644
--- a/tests/common/test_constants.h
+++ b/tests/common/test_constants.h
@@ -19,6 +19,8 @@
#include <stdlib.h>
+#include <string>
+
// Zip entries in ziptest_valid.zip.
static const std::string kATxtContents("abcdefghabcdefgh\n");
static const std::string kBTxtContents("abcdefgh\n");
@@ -30,10 +32,14 @@ static const std::string kATxtSha1Sum("32c96a03dc8cd20097940f351bca6261ee5a1643"
// echo -n -e "abcdefgh\n" | sha1sum
static const std::string kBTxtSha1Sum("e414af7161c9554089f4106d6f1797ef14a73666");
-static const char* data_root = getenv("ANDROID_DATA");
-
static std::string from_testdata_base(const std::string& fname) {
- return std::string(data_root) + "/nativetest/recovery/testdata/" + fname;
+#ifdef __ANDROID__
+ static std::string data_root = getenv("ANDROID_DATA");
+#else
+ static std::string data_root = std::string(getenv("ANDROID_PRODUCT_OUT")) + "/data";
+#endif
+
+ return data_root + "/nativetest/recovery/testdata/" + fname;
}
#endif // _OTA_TEST_CONSTANTS_H