comparison MemoryDBLink.cpp @ 73:c9447697609f

Fixed some issues with raise. 100% function code coverage for Exceptions.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Thu, 31 Jan 2013 20:33:01 +0100
parents b9515dc35fe4
children af7962f3274b
comparison
equal deleted inserted replaced
72:b4185273c14a 73:c9447697609f
1 #include "MemoryDBLink.hpp" 1 #include "MemoryDBLink.hpp"
2 2 #include "Exception/ValueExistsException.hpp"
3 #include <QtCore/QStringList> 3 #include <QtCore/QStringList>
4 4
5 void MemoryDBLink::addFile(const QString& path, qint64 size, 5 void MemoryDBLink::addFile(const QString& path, qint64 size,
6 const QDateTime& dtime, const QByteArray& hash) 6 const QDateTime& dtime, const QByteArray& hash)
7 { 7 {
20 } 20 }
21 21
22 void MemoryDBLink::addFile(const DBInfo& dbinfo) 22 void MemoryDBLink::addFile(const DBInfo& dbinfo)
23 { 23 {
24 if (!tryAddFile(dbinfo)) { 24 if (!tryAddFile(dbinfo)) {
25 abort(); //Should throw exception 25 QString msg = QString("Trying to add '%1', which already exists").arg(dbinfo.path());
26 throw ValueExistsException(msg);
26 } 27 }
27 } 28 }
28 29
29 30
30 QStringList MemoryDBLink::toStringList() 31 QStringList MemoryDBLink::toStringList()