diff options
author | Janusz Kozerski <j.kozerski@samsung.com> | 2015-08-04 11:59:59 +0200 |
---|---|---|
committer | Janusz Kozerski <j.kozerski@samsung.com> | 2015-09-08 09:40:51 +0200 |
commit | ae4a130374e96d383e09571f2e098ef237e28418 (patch) | |
tree | be1aec96429587bebab0b8395326c4dde558c56d /tests/test_db.cpp | |
parent | 4373c73514186ce90d71a0486447fa66dcf0a6c1 (diff) | |
download | cert-checker-ae4a130374e96d383e09571f2e098ef237e28418.tar.gz cert-checker-ae4a130374e96d383e09571f2e098ef237e28418.tar.bz2 cert-checker-ae4a130374e96d383e09571f2e098ef237e28418.zip |
Use new cert-svc-vcore API: makeChainBySignature()
This change includes adding cert_order in DB.
Chain of certificates should be created while reading/parsing signature.
Certificates should be put into DB in right order - first should go
end entity certificate. DB ensures that certificates will be loaded into the
buffer in exactly same order (end entity will be the first element on the list).
Verification: Run tests, all should pass.
Change-Id: I09571bab7862bdb539dd3a957330fe23d687b48f
Diffstat (limited to 'tests/test_db.cpp')
-rw-r--r-- | tests/test_db.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/test_db.cpp b/tests/test_db.cpp index 066e895..95267e5 100644 --- a/tests/test_db.cpp +++ b/tests/test_db.cpp @@ -127,16 +127,15 @@ BOOST_AUTO_TEST_CASE(DB_app_positive) { app2.verified = app_t::verified_t::NO; app3.verified = app_t::verified_t::YES; - sort(app1); - sort(app2); - sort(app3); - sort(app4); + std::list<app_t> buffer_ok = {app1, app2, app3, app4}; get_app_list(buffer); - buffer.sort(); - buffer_ok.sort(); + // Need to sort buffer + sort_buffer(buffer); + sort_buffer(buffer_ok); + BOOST_REQUIRE(buffer_ok == buffer); } @@ -173,17 +172,14 @@ BOOST_AUTO_TEST_CASE(DB_app_negative) { app2.verified = app_t::verified_t::NO; app3.verified = app_t::verified_t::YES; - sort(app1); - sort(app2); - sort(app3); - sort(app4); + std::list<app_t> buffer_ok = {app1, app2, app3, app4}; get_app_list(buffer); // list has to be sorted before comparison. - buffer.sort(); - buffer_ok.sort(); + sort_buffer(buffer); + sort_buffer(buffer_ok); BOOST_REQUIRE(buffer_ok != buffer); } |