From bfad644e448077931e27814be9dfa6891db8619a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 1 Jan 2017 15:51:09 +0000 Subject: Register mock db implementations --- libsqlitepp/sqlite-mock.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libsqlitepp/sqlite-mock.cpp') diff --git a/libsqlitepp/sqlite-mock.cpp b/libsqlitepp/sqlite-mock.cpp index bcacbde..6a2edb5 100644 --- a/libsqlitepp/sqlite-mock.cpp +++ b/libsqlitepp/sqlite-mock.cpp @@ -3,16 +3,23 @@ #include #include +NAMEDFACTORY("sqlite", SQLite::Mock, DB::MockDatabaseFactory); + namespace SQLite { -Mock::Mock(const std::string & name, const std::vector & ss) : +Mock::Mock(const std::string & root, const std::string & name, const std::vector & ss) : MockDatabase(name), - testDbPath(boost::filesystem::path("/tmp") / "sqliteut" / boost::lexical_cast(getpid()) / boost::lexical_cast(++DB::MockDatabase::mocked)) + testDbPath(boost::filesystem::path(root) / boost::lexical_cast(getpid()) / boost::lexical_cast(++DB::MockDatabase::mocked)) { CreateNewDatabase(); PlaySchemaScripts(ss); } +Mock::Mock(const std::string & name, const std::vector & ss) : + Mock("/tmp/sqliteut", name, ss) +{ +} + DB::Connection * Mock::openConnection() const { -- cgit v1.2.3