diff options
Diffstat (limited to 'libmysqlpp/unittests')
-rw-r--r-- | libmysqlpp/unittests/testmysql.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
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 <boost/test/unit_test.hpp> #include <my-mock.h> +#include <my-error.h> #include <definedDirs.h> -#include <dbpp/modifycommand.h> -#include <dbpp/selectcommand.h> -#include <dbpp/column.h> +#include <modifycommand.h> +#include <selectcommand.h> +#include <column.h> +#include <connection.h> #include <testCore.h> #include <fstream> #include <boost/date_time/posix_time/posix_time.hpp> @@ -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(); |