aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-01-09 21:40:27 -0500
committerJack Lloyd <[email protected]>2017-01-09 21:40:27 -0500
commit0b509f458b79965eedc6fbadd35319a7a28e7d4f (patch)
tree550914dd5cad104ecc33f15bf5479793b3ad84d1
parent6e705cf812bbb43fa0d80c09d7da0ace6605693f (diff)
Avoid creating+deleting test DB for certstore
Just use in-memory sqlite DB instead
-rw-r--r--src/tests/test_certstor.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tests/test_certstor.cpp b/src/tests/test_certstor.cpp
index 693630e54..cacaf8d0e 100644
--- a/src/tests/test_certstor.cpp
+++ b/src/tests/test_certstor.cpp
@@ -12,9 +12,6 @@
#include <botan/internal/filesystem.h>
#include <botan/pkcs8.h>
#include <sstream>
- extern "C" {
- #include <unistd.h> // unlink()
- }
#endif
@@ -209,11 +206,11 @@ class Certstor_Tests : public Test
try
{
- unlink((fn.first + ".db").c_str());
-
auto& rng = Test::rng();
std::string passwd(reinterpret_cast<const char*>(rng.random_vec(8).data()),8);
- Botan::Certificate_Store_In_SQLite store(fn.first + ".db", passwd, rng);
+
+ // Just create a database in memory for testing (https://sqlite.org/inmemorydb.html)
+ Botan::Certificate_Store_In_SQLite store(":memory:", passwd, rng);
std::vector<std::pair<Botan::X509_Certificate,std::shared_ptr<Botan::Private_Key>>> retrieve;
for(auto&& cert_key_pair : test_data)