aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-12-22 14:17:59 +0100
committerSimon Warta <[email protected]>2015-12-22 14:17:59 +0100
commit2e84cd95d8a210a5a6cf512a11e54bfa1e2bfc04 (patch)
treeafa6f33940c58adee0b34a968ad0f099f6709fa5 /src
parenta589d7a2ede70871d3f563ed34cdd3c10046e5c2 (diff)
Use --data-dir in test X509test_Path
This allows me to build and run tests out-of-tree :)
Diffstat (limited to 'src')
-rw-r--r--src/tests/test_x509_path.cpp11
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,