summaryrefslogtreecommitdiff
path: root/libpqpp/unittests/testpq.cpp
diff options
context:
space:
mode:
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);
+}
+