From 209a3c691eabaaf4c77469f43237673936c842dc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Nov 2015 02:35:35 +0000 Subject: Add connection error test --- libdbpp/unittests/testConnection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libdbpp/unittests/testConnection.cpp b/libdbpp/unittests/testConnection.cpp index 2e8a7a2..6d9cd05 100644 --- a/libdbpp/unittests/testConnection.cpp +++ b/libdbpp/unittests/testConnection.cpp @@ -6,6 +6,7 @@ #include #include #include +#include // LCOV_EXCL_START class MockDb : public DB::Connection { @@ -95,3 +96,8 @@ BOOST_AUTO_TEST_CASE( savepoints ) delete mock; } +BOOST_AUTO_TEST_CASE( connectError ) +{ + BOOST_REQUIRE_THROW(DB::ConnectionFactory::createNew("postgresql", "user=fail dbname=nodb"), DB::ConnectionError); +} + -- cgit v1.2.3