diff options
Diffstat (limited to 'libsqlitepp/mock.cpp')
-rw-r--r-- | libsqlitepp/mock.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/libsqlitepp/mock.cpp b/libsqlitepp/mock.cpp deleted file mode 100644 index 4748116..0000000 --- a/libsqlitepp/mock.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "mock.h" -#include "connection.h" -#include <buffer.h> -#include <boost/filesystem/operations.hpp> - -namespace SQLite { - -Mock::Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss) : - MockDatabase(name), - testDbPath(boost::filesystem::path("/tmp") / "sqliteut" / stringbf("%d", getpid()) / stringbf("%d", ++DB::MockDatabase::mocked)) -{ - CreateNewDatabase(); - PlaySchemaScripts(ss); -} - -DB::Connection * -Mock::openConnection() const -{ - return new Connection(testDbPath.string()); -} - -Mock::~Mock() -{ - DropDatabase(); -} - -void Mock::DropDatabase() const -{ - boost::filesystem::remove(testDbPath); -} - -void Mock::CreateNewDatabase() const -{ - boost::filesystem::create_directories(testDbPath.parent_path()); - delete openConnection(); -} - -} - |