Mercurial > dedupe
view TestDataBase.cpp @ 100:f4ebbfa3ffae
Beautify progressreport update, and do lstat rather than stat when checking if a file is a link
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Thu, 13 Feb 2014 14:55:11 +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; }
