summaryrefslogtreecommitdiff
path: root/libmysqlpp/embeddedmy-mock.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-31 04:04:31 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2017-05-04 20:44:40 +0100
commitdb1e2f066393af3e58814417de5bbe7ea08a145d (patch)
tree9d01e48d8ef7d63fbcca6aced2461b3f1e234dfd /libmysqlpp/embeddedmy-mock.h
parentBeginnings of embbeded MySQL (diff)
downloadlibdbpp-mysql-db1e2f066393af3e58814417de5bbe7ea08a145d.tar.bz2
libdbpp-mysql-db1e2f066393af3e58814417de5bbe7ea08a145d.tar.xz
libdbpp-mysql-db1e2f066393af3e58814417de5bbe7ea08a145d.zip
Basics working, could do with a tidy up around mocking
Diffstat (limited to 'libmysqlpp/embeddedmy-mock.h')
-rw-r--r--libmysqlpp/embeddedmy-mock.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/libmysqlpp/embeddedmy-mock.h b/libmysqlpp/embeddedmy-mock.h
index 0b90b4b..cad10eb 100644
--- a/libmysqlpp/embeddedmy-mock.h
+++ b/libmysqlpp/embeddedmy-mock.h
@@ -4,26 +4,30 @@
#include <mockDatabase.h>
#include <boost/filesystem/path.hpp>
#include <visibility.h>
+#include <boost/shared_ptr.hpp>
+#include "embeddedmy-server.h"
namespace MySQL {
-namespace Embedded {
+ namespace Embedded {
+ class DLL_PUBLIC Mock : public DB::MockDatabase {
+ public:
+ Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss);
+ ~Mock();
-class DLL_PUBLIC Mock : public DB::MockDatabase {
- public:
- Mock(const std::string & name, const std::vector<boost::filesystem::path> & ss);
- ~Mock();
+ protected:
+ void DropDatabase() const override;
+ void CreateNewDatabase() const override;
- protected:
- void DropDatabase() const override;
- void CreateNewDatabase() const override;
+ DB::Connection * openConnection() const override;
- DB::Connection * openConnection() const override;
+ private:
+ static boost::filesystem::path mockDbPath();
- private:
- const boost::filesystem::path testDbPath;
-};
+ std::string dbname;
+ mutable ServerPtr embeddedServer;
+ };
-}
+ }
}
#endif