diff options
Diffstat (limited to 'libodbcpp/unittests/testodbc.cpp')
-rw-r--r-- | libodbcpp/unittests/testodbc.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libodbcpp/unittests/testodbc.cpp b/libodbcpp/unittests/testodbc.cpp index f288bf8..77f0a71 100644 --- a/libodbcpp/unittests/testodbc.cpp +++ b/libodbcpp/unittests/testodbc.cpp @@ -13,10 +13,16 @@ class StandardMockDatabase : public ODBC::Mock { public: - StandardMockDatabase() : ODBC::Mock("Driver=postgresql;Database=postgres;uid=postgres;servername=/run/postgresql", "odbcmock", { + StandardMockDatabase() : ODBC::Mock("Driver=psqlodbcw.so;uid=postgres;servername=/run/postgresql", "Database=postgres", "odbcmock", { rootDir / "odbcschema.sql" }) { } + + void DropDatabase() const override + { + master->execute("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '" + testDbName + "'"); + ODBC::Mock::DropDatabase(); + } }; BOOST_GLOBAL_FIXTURE( StandardMockDatabase ); |