summaryrefslogtreecommitdiff
path: root/libpqpp/unittests/testpq.cpp
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
commit0768666d941af819c8fc20fc872609d4107c7bd2 (patch)
tree50b46946e1eb2a52189670661054744e3c5664fc /libpqpp/unittests/testpq.cpp
parentTidy up and alias glibmm and libxml++ refs (diff)
downloadlibdbpp-postgresql-0768666d941af819c8fc20fc872609d4107c7bd2.tar.bz2
libdbpp-postgresql-0768666d941af819c8fc20fc872609d4107c7bd2.tar.xz
libdbpp-postgresql-0768666d941af819c8fc20fc872609d4107c7bd2.zip
Propergate connection error details into DB::Error and add test
Diffstat (limited to 'libpqpp/unittests/testpq.cpp')
-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);
+}
+