diff options
author | Simon Warta <[email protected]> | 2015-12-22 14:17:59 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-12-22 14:17:59 +0100 |
commit | 2e84cd95d8a210a5a6cf512a11e54bfa1e2bfc04 (patch) | |
tree | afa6f33940c58adee0b34a968ad0f099f6709fa5 /src/tests/test_x509_path.cpp | |
parent | a589d7a2ede70871d3f563ed34cdd3c10046e5c2 (diff) |
Use --data-dir in test X509test_Path
This allows me to build and run tests out-of-tree :)
Diffstat (limited to 'src/tests/test_x509_path.cpp')
-rw-r--r-- | src/tests/test_x509_path.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tests/test_x509_path.cpp b/src/tests/test_x509_path.cpp index 149c6ec2a..a7da0ee18 100644 --- a/src/tests/test_x509_path.cpp +++ b/src/tests/test_x509_path.cpp @@ -33,26 +33,25 @@ class X509test_Path_Validation_Tests : public Test std::vector<Test::Result> results; // Test certs generated by https://github.com/yymax/x509test - const std::string test_dir = "src/tests/data/x509test"; - std::map<std::string, std::string> expected = read_results(test_dir + "/expected.txt"); + std::map<std::string, std::string> expected = read_results(data_file("x509test/expected.txt")); const Botan::Path_Validation_Restrictions default_restrictions; - Botan::X509_Certificate root(test_dir + "/root.pem"); + Botan::X509_Certificate root(data_file("x509test/root.pem")); Botan::Certificate_Store_In_Memory trusted; trusted.add_certificate(root); for(auto i = expected.begin(); i != expected.end(); ++i) { Test::Result result("X509test path validation"); - const std::string fsname = i->first; + const std::string filename = i->first; const std::string expected = i->second; - std::vector<Botan::X509_Certificate> certs = load_cert_file(test_dir + "/" + fsname); + std::vector<Botan::X509_Certificate> certs = load_cert_file(data_file("x509test/" + filename)); if(certs.empty()) - throw Test_Error("Failed to read certs from " + fsname); + throw Test_Error("Failed to read certs from " + filename); Botan::Path_Validation_Result path_result = Botan::x509_path_validate( certs, default_restrictions, trusted, |