summaryrefslogtreecommitdiff
path: root/libmysqlpp
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqlpp')
-rw-r--r--libmysqlpp/my-error.h4
-rw-r--r--libmysqlpp/my-mock.h7
-rw-r--r--libmysqlpp/unittests/testmysql.cpp4
3 files changed, 10 insertions, 5 deletions
diff --git a/libmysqlpp/my-error.h b/libmysqlpp/my-error.h
index d1dbe68..b48c4a6 100644
--- a/libmysqlpp/my-error.h
+++ b/libmysqlpp/my-error.h
@@ -8,8 +8,8 @@
namespace MySQL {
class Error : public AdHoc::Exception<DB::Error> {
public:
- Error(MYSQL_STMT *);
- Error(MYSQL *);
+ explicit Error(MYSQL_STMT *);
+ explicit Error(MYSQL *);
std::string message() const noexcept override;
private:
diff --git a/libmysqlpp/my-mock.h b/libmysqlpp/my-mock.h
index 60aa124..6be9750 100644
--- a/libmysqlpp/my-mock.h
+++ b/libmysqlpp/my-mock.h
@@ -4,16 +4,19 @@
#include <mockDatabase.h>
#include <filesystem>
#include <visibility.h>
+#include <c++11Helpers.h>
namespace MySQL {
class DLL_PUBLIC Mock : public DB::MockServerDatabase {
public:
Mock(const std::string & master, const std::string & name, const std::vector<std::filesystem::path> & ss);
- ~Mock();
+ ~Mock() override;
+
+ SPECIAL_MEMBERS_MOVE_RO(Mock);
private:
- DB::ConnectionPtr openConnection() const override;
+ [[nodiscard]] DB::ConnectionPtr openConnection() const override;
};
}
diff --git a/libmysqlpp/unittests/testmysql.cpp b/libmysqlpp/unittests/testmysql.cpp
index 7795a0b..17f807e 100644
--- a/libmysqlpp/unittests/testmysql.cpp
+++ b/libmysqlpp/unittests/testmysql.cpp
@@ -147,7 +147,9 @@ BOOST_AUTO_TEST_CASE( errors )
{
auto ro = DB::MockDatabase::openConnectionTo("mysqlmock");
BOOST_REQUIRE_THROW(ro->execute("nonsense"), DB::Error);
- BOOST_REQUIRE_THROW(DB::ConnectionFactory::createNew("mysql", "server=nohost"), DB::ConnectionError);
+ BOOST_REQUIRE_THROW(
+ (void)DB::ConnectionFactory::createNew("mysql", "server=nohost"),
+ DB::ConnectionError);
}
BOOST_AUTO_TEST_SUITE_END();