summaryrefslogtreecommitdiff
path: root/libmysqlpp/unittests
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 02:42:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 06:00:07 +0000
commit97c3d4c1604b525e4522814e34723488c59a83f5 (patch)
treecd9ca0e4b7013d4af1c85c4a677a2cbb12bb9603 /libmysqlpp/unittests
parentRemove rebind (diff)
downloadlibdbpp-mysql-97c3d4c1604b525e4522814e34723488c59a83f5.tar.bz2
libdbpp-mysql-97c3d4c1604b525e4522814e34723488c59a83f5.tar.xz
libdbpp-mysql-97c3d4c1604b525e4522814e34723488c59a83f5.zip
Reshuffle and add new exceptions
Diffstat (limited to 'libmysqlpp/unittests')
-rw-r--r--libmysqlpp/unittests/testmysql.cpp16
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();