From 5cda5f14ebcf8a047c202ec98c28ba8b2f02dd81 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 19 Nov 2015 21:25:27 +0000 Subject: Expose the mocked database instance name --- libdbpp/mockDatabase.cpp | 6 ++++++ libdbpp/mockDatabase.h | 3 +++ 2 files changed, 9 insertions(+) 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; -- cgit v1.2.3