summaryrefslogtreecommitdiff
path: root/libpqpp/unittests
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-02 21:21:57 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-02 21:21:57 +0000
commit2b560da989ca1809196389b1651f520ecca7667c (patch)
tree21e7179456ba5dd7ea399819032b44cc90c65c44 /libpqpp/unittests
parentTidy up and alias glibmm and libxml++ refs (diff)
downloadlibdbpp-postgresql-2b560da989ca1809196389b1651f520ecca7667c.tar.bz2
libdbpp-postgresql-2b560da989ca1809196389b1651f520ecca7667c.tar.xz
libdbpp-postgresql-2b560da989ca1809196389b1651f520ecca7667c.zip
Propergate connection error details into DB::Error and add test
Diffstat (limited to 'libpqpp/unittests')
-rw-r--r--libpqpp/unittests/testpq.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpqpp/unittests/testpq.cpp b/libpqpp/unittests/testpq.cpp
index cf366cb..5dc4b2d 100644
--- a/libpqpp/unittests/testpq.cpp
+++ b/libpqpp/unittests/testpq.cpp
@@ -9,6 +9,7 @@
#include <testCore.h>
#include <fstream>
#include <boost/date_time/posix_time/posix_time.hpp>
+#include "../error.h"
class StandardMockDatabase : public PQ::Mock {
public:
@@ -169,3 +170,8 @@ BOOST_AUTO_TEST_CASE( insertId )
BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_CASE( connfail )
+{
+ BOOST_REQUIRE_THROW(DB::ConnectionFactory::createNew("postgresql", "host=localhost user=no"), PQ::ConnectionError);
+}
+