summaryrefslogtreecommitdiffstats
path: root/tests/component/verifier_test.cpp
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-03-12 20:40:14 +0100
committerxunchang <xunchang@google.com>2019-03-14 23:35:09 +0100
commit37304f3cc920804c97d52df929b9871c057c55e0 (patch)
tree3417ec3d003d01cdbe69a5ab876f591602baf4a9 /tests/component/verifier_test.cpp
parentMerge "Start charger at /system/bin/charger." (diff)
downloadandroid_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.tar
android_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.tar.gz
android_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.tar.bz2
android_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.tar.lz
android_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.tar.xz
android_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.tar.zst
android_bootable_recovery-37304f3cc920804c97d52df929b9871c057c55e0.zip
Diffstat (limited to 'tests/component/verifier_test.cpp')
-rw-r--r--tests/component/verifier_test.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/component/verifier_test.cpp b/tests/component/verifier_test.cpp
index c26d76d73..c904cd038 100644
--- a/tests/component/verifier_test.cpp
+++ b/tests/component/verifier_test.cpp
@@ -240,8 +240,10 @@ class VerifierTest : public testing::TestWithParam<std::vector<std::string>> {
void SetUp() override {
std::vector<std::string> args = GetParam();
std::string path = from_testdata_base(args[0]);
- package_ = Package::CreateMemoryPackage(path, nullptr);
- ASSERT_NE(nullptr, package_);
+ memory_package_ = Package::CreateMemoryPackage(path, nullptr);
+ ASSERT_NE(nullptr, memory_package_);
+ file_package_ = Package::CreateFilePackage(path, nullptr);
+ ASSERT_NE(nullptr, file_package_);
for (auto it = ++args.cbegin(); it != args.cend(); ++it) {
std::string public_key_file = from_testdata_base("testkey_" + *it + ".x509.pem");
@@ -250,7 +252,8 @@ class VerifierTest : public testing::TestWithParam<std::vector<std::string>> {
}
}
- std::unique_ptr<Package> package_;
+ std::unique_ptr<Package> memory_package_;
+ std::unique_ptr<Package> file_package_;
std::vector<Certificate> certs_;
};
@@ -304,11 +307,13 @@ TEST(VerifierTest, BadPackage_SignatureStartOutOfBounds) {
}
TEST_P(VerifierSuccessTest, VerifySucceed) {
- ASSERT_EQ(VERIFY_SUCCESS, verify_file(package_.get(), certs_));
+ ASSERT_EQ(VERIFY_SUCCESS, verify_file(memory_package_.get(), certs_));
+ ASSERT_EQ(VERIFY_SUCCESS, verify_file(file_package_.get(), certs_));
}
TEST_P(VerifierFailureTest, VerifyFailure) {
- ASSERT_EQ(VERIFY_FAILURE, verify_file(package_.get(), certs_));
+ ASSERT_EQ(VERIFY_FAILURE, verify_file(memory_package_.get(), certs_));
+ ASSERT_EQ(VERIFY_FAILURE, verify_file(file_package_.get(), certs_));
}
INSTANTIATE_TEST_CASE_P(SingleKeySuccess, VerifierSuccessTest,