diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-11-08 02:35:35 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-11-08 02:35:35 +0000 |
commit | 209a3c691eabaaf4c77469f43237673936c842dc (patch) | |
tree | d07ff660579d9cdba36d4d3e19c39acc43d1dd2b | |
parent | Add boolean column to util test (diff) | |
download | libdbpp-209a3c691eabaaf4c77469f43237673936c842dc.tar.bz2 libdbpp-209a3c691eabaaf4c77469f43237673936c842dc.tar.xz libdbpp-209a3c691eabaaf4c77469f43237673936c842dc.zip |
Add connection error test
-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); +} + |