From 97c3d4c1604b525e4522814e34723488c59a83f5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 29 Dec 2015 02:42:43 +0000 Subject: Reshuffle and add new exceptions --- libmysqlpp/unittests/testmysql.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libmysqlpp/unittests/testmysql.cpp') diff --git a/libmysqlpp/unittests/testmysql.cpp b/libmysqlpp/unittests/testmysql.cpp index 827ae84..f8c46b6 100644 --- a/libmysqlpp/unittests/testmysql.cpp +++ b/libmysqlpp/unittests/testmysql.cpp @@ -2,10 +2,12 @@ #include #include +#include #include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -157,5 +159,13 @@ BOOST_AUTO_TEST_CASE( insertId ) delete ro; } +BOOST_AUTO_TEST_CASE( errors ) +{ + auto ro = DB::MockDatabase::openConnectionTo("mysqlmock"); + BOOST_REQUIRE_THROW(ro->execute("nonsense"), DB::Error); + delete ro; + BOOST_REQUIRE_THROW(DB::ConnectionFactory::createNew("mysql", "server=nohost"), DB::ConnectionError); +} + BOOST_AUTO_TEST_SUITE_END(); -- cgit v1.2.3