summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-11-19 21:25:27 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-11-19 21:25:27 +0000
commit5cda5f14ebcf8a047c202ec98c28ba8b2f02dd81 (patch)
tree5f0a7c01c70bc935ccf566cde7a0348c9ceb88ae
parentImprove exceptions in SQL parser to include line number (diff)
downloadlibdbpp-5cda5f14ebcf8a047c202ec98c28ba8b2f02dd81.tar.bz2
libdbpp-5cda5f14ebcf8a047c202ec98c28ba8b2f02dd81.tar.xz
libdbpp-5cda5f14ebcf8a047c202ec98c28ba8b2f02dd81.zip
Expose the mocked database instance name
-rw-r--r--libdbpp/mockDatabase.cpp6
-rw-r--r--libdbpp/mockDatabase.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/libdbpp/mockDatabase.cpp b/libdbpp/mockDatabase.cpp
index 9cb916f..db192bd 100644
--- a/libdbpp/mockDatabase.cpp
+++ b/libdbpp/mockDatabase.cpp
@@ -117,6 +117,12 @@ MockServerDatabase::~MockServerDatabase()
delete master;
}
+const std::string &
+MockServerDatabase::databaseName() const
+{
+ return testDbName;
+}
+
void
MockServerDatabase::CreateNewDatabase() const
{
diff --git a/libdbpp/mockDatabase.h b/libdbpp/mockDatabase.h
index 4cd9da1..7508881 100644
--- a/libdbpp/mockDatabase.h
+++ b/libdbpp/mockDatabase.h
@@ -56,6 +56,9 @@ class DLL_PUBLIC MockServerDatabase : public MockDatabase {
MockServerDatabase(const std::string & masterdb, const std::string & name, const std::string & type);
virtual ~MockServerDatabase();
+ /// Get the database instance name on the server.
+ const std::string & databaseName() const;
+
protected:
virtual void CreateNewDatabase() const override;
virtual void DropDatabase() const override;