diff options
Diffstat (limited to 'tests/component/verifier_test.cpp')
-rw-r--r-- | tests/component/verifier_test.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/component/verifier_test.cpp b/tests/component/verifier_test.cpp index 7f9a7140..60a78f5c 100644 --- a/tests/component/verifier_test.cpp +++ b/tests/component/verifier_test.cpp | |||
@@ -37,9 +37,6 @@ | |||
37 | #include "ui.h" | 37 | #include "ui.h" |
38 | #include "verifier.h" | 38 | #include "verifier.h" |
39 | 39 | ||
40 | static const char* DATA_PATH = getenv("ANDROID_DATA"); | ||
41 | static const char* TESTDATA_PATH = "/recovery/testdata/"; | ||
42 | |||
43 | RecoveryUI* ui = NULL; | 40 | RecoveryUI* ui = NULL; |
44 | 41 | ||
45 | class MockUI : public RecoveryUI { | 42 | class MockUI : public RecoveryUI { |
@@ -92,17 +89,13 @@ class VerifierTest : public testing::TestWithParam<std::vector<std::string>> { | |||
92 | 89 | ||
93 | virtual void SetUp() { | 90 | virtual void SetUp() { |
94 | std::vector<std::string> args = GetParam(); | 91 | std::vector<std::string> args = GetParam(); |
95 | std::string package = | 92 | std::string package = from_testdata_base(args[0]); |
96 | android::base::StringPrintf("%s%s%s%s", DATA_PATH, NATIVE_TEST_PATH, | ||
97 | TESTDATA_PATH, args[0].c_str()); | ||
98 | if (sysMapFile(package.c_str(), &memmap) != 0) { | 93 | if (sysMapFile(package.c_str(), &memmap) != 0) { |
99 | FAIL() << "Failed to mmap " << package << ": " << strerror(errno) << "\n"; | 94 | FAIL() << "Failed to mmap " << package << ": " << strerror(errno) << "\n"; |
100 | } | 95 | } |
101 | 96 | ||
102 | for (auto it = ++(args.cbegin()); it != args.cend(); ++it) { | 97 | for (auto it = ++(args.cbegin()); it != args.cend(); ++it) { |
103 | std::string public_key_file = android::base::StringPrintf( | 98 | std::string public_key_file = from_testdata_base("testkey_" + *it + ".txt"); |
104 | "%s%s%stestkey_%s.txt", DATA_PATH, NATIVE_TEST_PATH, | ||
105 | TESTDATA_PATH, it->c_str()); | ||
106 | ASSERT_TRUE(load_keys(public_key_file.c_str(), certs)); | 99 | ASSERT_TRUE(load_keys(public_key_file.c_str(), certs)); |
107 | } | 100 | } |
108 | } | 101 | } |