From ba4428b8c3e53fa42e7dd0f6692538e83d2b816b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 1 Jan 2017 15:51:09 +0000 Subject: Register mock db implementations --- libmysqlpp/my-mock.cpp | 11 +++++++++-- libmysqlpp/my-mock.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'libmysqlpp') 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 +NAMEDFACTORY("mysql", MySQL::Mock, DB::MockDatabaseFactory); + namespace MySQL { -Mock::Mock(const std::string & name, const std::vector & ss) : - MockServerDatabase("options=p2testmysql", name, "mysql") +Mock::Mock(const std::string & master, const std::string & name, const std::vector & ss) : + MockServerDatabase(master, name, "mysql") { CreateNewDatabase(); PlaySchemaScripts(ss); } +Mock::Mock(const std::string & name, const std::vector & ss) : + Mock("options=p2testmysql", name, ss) +{ +} + AdHocFormatter(MockConnStr, "options=p2testmysql;database=%?"); DB::Connection * Mock::openConnection() const diff --git a/libmysqlpp/my-mock.h b/libmysqlpp/my-mock.h index ce4fdf2..0855015 100644 --- a/libmysqlpp/my-mock.h +++ b/libmysqlpp/my-mock.h @@ -9,6 +9,7 @@ namespace MySQL { class DLL_PUBLIC Mock : public DB::MockServerDatabase { public: + Mock(const std::string & master, const std::string & name, const std::vector & ss); Mock(const std::string & name, const std::vector & ss); ~Mock(); -- cgit v1.2.3