diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-01-01 15:51:09 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-01-01 15:51:09 +0000 |
commit | ba4428b8c3e53fa42e7dd0f6692538e83d2b816b (patch) | |
tree | 5a18cfda692a8d6e8c1a470d3359a1fd61c83618 /libmysqlpp/my-mock.cpp | |
parent | Do lots more work with compile time formatter instead runtime formatters (diff) | |
download | libdbpp-mysql-ba4428b8c3e53fa42e7dd0f6692538e83d2b816b.tar.bz2 libdbpp-mysql-ba4428b8c3e53fa42e7dd0f6692538e83d2b816b.tar.xz libdbpp-mysql-ba4428b8c3e53fa42e7dd0f6692538e83d2b816b.zip |
Register mock db implementations
Diffstat (limited to 'libmysqlpp/my-mock.cpp')
-rw-r--r-- | libmysqlpp/my-mock.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libmysqlpp/my-mock.cpp b/libmysqlpp/my-mock.cpp index 2eee416..8cf3057 100644 --- a/libmysqlpp/my-mock.cpp +++ b/libmysqlpp/my-mock.cpp @@ -2,15 +2,22 @@ #include "my-mock.h" #include <compileTimeFormatter.h> +NAMEDFACTORY("mysql", MySQL::Mock, DB::MockDatabaseFactory); + namespace MySQL { -Mock::Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss) : - MockServerDatabase("options=p2testmysql", name, "mysql") +Mock::Mock(const std::string & master, const std::string & name, const std::vector<boost::filesystem::path> & ss) : + MockServerDatabase(master, name, "mysql") { CreateNewDatabase(); PlaySchemaScripts(ss); } +Mock::Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss) : + Mock("options=p2testmysql", name, ss) +{ +} + AdHocFormatter(MockConnStr, "options=p2testmysql;database=%?"); DB::Connection * Mock::openConnection() const |