diff options
-rw-r--r-- | libdbpp/unittests/testConnection.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 <definedDirs.h> #include <fstream> #include <vector> +#include <error.h> // 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); +} + |