Mercurial > dedupe
view TestDataBase.cpp @ 104:6bc013d5788b
Avoid unnecessary updates.
Fix problems with wrong subset being selected for update with prefix.
Fix some problems with to much verbosity in debug statements.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Sat, 15 Feb 2014 13:34:10 +0100 |
| parents | a827f3687c4a |
| children |
line wrap: on
line source
#include "TestDataBase.hpp" #include "Exception/IOException.hpp" TestDatabase::TestDatabase() : connectionName("TestDatabase"), db(new QSqlDatabase) { *db = QSqlDatabase::addDatabase("QSQLITE", connectionName); const QString dbPath(":memory:"); db->setDatabaseName(dbPath); if (!db->open()) throw IOException(QString("Unable to open SQLite database with path '%1'") .arg(dbPath)); } TestDatabase::~TestDatabase() { db->close(); delete db; QSqlDatabase::removeDatabase(connectionName); } QSqlDatabase TestDatabase::getDatabase() { return *db; }
