2010-08-13 12:08:06 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
2017-06-09 17:40:36 -04:00
|
|
|
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
2010-08-13 12:08:06 -04:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-11-21 17:06:30 -05:00
|
|
|
#include "TestGroup.h"
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
#include <QDebug>
|
2013-10-03 09:18:16 -04:00
|
|
|
#include <QPointer>
|
2017-11-27 15:41:58 -05:00
|
|
|
#include <QScopedPointer>
|
2013-10-03 09:18:16 -04:00
|
|
|
#include <QSignalSpy>
|
|
|
|
#include <QTest>
|
2010-08-13 12:08:06 -04:00
|
|
|
|
|
|
|
#include "core/Database.h"
|
2011-07-08 07:57:02 -04:00
|
|
|
#include "core/Group.h"
|
2012-04-27 05:22:02 -04:00
|
|
|
#include "core/Metadata.h"
|
2011-11-12 14:00:19 -05:00
|
|
|
#include "crypto/Crypto.h"
|
2010-08-13 12:08:06 -04:00
|
|
|
|
2014-05-16 06:32:52 -04:00
|
|
|
QTEST_GUILESS_MAIN(TestGroup)
|
|
|
|
|
2010-09-18 11:15:22 -04:00
|
|
|
void TestGroup::initTestCase()
|
|
|
|
{
|
2012-04-18 11:42:55 -04:00
|
|
|
qRegisterMetaType<Entry*>("Entry*");
|
2010-09-18 11:15:22 -04:00
|
|
|
qRegisterMetaType<Group*>("Group*");
|
2014-06-15 05:17:40 -04:00
|
|
|
QVERIFY(Crypto::init());
|
2010-09-18 11:15:22 -04:00
|
|
|
}
|
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
void TestGroup::testParenting()
|
|
|
|
{
|
|
|
|
Database* db = new Database();
|
2011-07-09 15:54:01 -04:00
|
|
|
QPointer<Group> rootGroup = db->rootGroup();
|
2010-08-13 12:08:06 -04:00
|
|
|
Group* tmpRoot = new Group();
|
|
|
|
|
2011-06-29 12:40:26 -04:00
|
|
|
QPointer<Group> g1 = new Group();
|
|
|
|
QPointer<Group> g2 = new Group();
|
|
|
|
QPointer<Group> g3 = new Group();
|
|
|
|
QPointer<Group> g4 = new Group();
|
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
g1->setParent(tmpRoot);
|
|
|
|
g2->setParent(tmpRoot);
|
|
|
|
g3->setParent(tmpRoot);
|
|
|
|
g4->setParent(tmpRoot);
|
|
|
|
|
|
|
|
g2->setParent(g1);
|
|
|
|
g4->setParent(g3);
|
|
|
|
g3->setParent(g1);
|
2011-07-09 15:54:01 -04:00
|
|
|
g1->setParent(db->rootGroup());
|
2010-08-13 12:08:06 -04:00
|
|
|
|
2011-07-09 15:54:01 -04:00
|
|
|
QVERIFY(g1->parent() == rootGroup);
|
2010-08-13 12:08:06 -04:00
|
|
|
QVERIFY(g2->parent() == g1);
|
|
|
|
QVERIFY(g3->parent() == g1);
|
|
|
|
QVERIFY(g4->parent() == g3);
|
|
|
|
|
2010-08-14 08:26:25 -04:00
|
|
|
QVERIFY(g1->database() == db);
|
|
|
|
QVERIFY(g2->database() == db);
|
|
|
|
QVERIFY(g3->database() == db);
|
|
|
|
QVERIFY(g4->database() == db);
|
|
|
|
|
2010-08-18 05:05:46 -04:00
|
|
|
QCOMPARE(tmpRoot->children().size(), 0);
|
2011-07-09 15:54:01 -04:00
|
|
|
QCOMPARE(rootGroup->children().size(), 1);
|
2010-08-18 05:05:46 -04:00
|
|
|
QCOMPARE(g1->children().size(), 2);
|
|
|
|
QCOMPARE(g2->children().size(), 0);
|
|
|
|
QCOMPARE(g3->children().size(), 1);
|
|
|
|
QCOMPARE(g4->children().size(), 0);
|
2010-08-13 12:08:06 -04:00
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QVERIFY(rootGroup->children().at(0) == g1);
|
2011-07-09 15:54:01 -04:00
|
|
|
QVERIFY(rootGroup->children().at(0) == g1);
|
2010-08-15 06:31:48 -04:00
|
|
|
QVERIFY(g1->children().at(0) == g2);
|
|
|
|
QVERIFY(g1->children().at(1) == g3);
|
2010-08-13 12:08:06 -04:00
|
|
|
QVERIFY(g3->children().contains(g4));
|
2010-08-15 09:03:47 -04:00
|
|
|
|
2012-04-25 04:17:24 -04:00
|
|
|
Group* g5 = new Group();
|
|
|
|
Group* g6 = new Group();
|
|
|
|
g5->setParent(db->rootGroup());
|
|
|
|
g6->setParent(db->rootGroup());
|
|
|
|
QVERIFY(db->rootGroup()->children().at(1) == g5);
|
|
|
|
QVERIFY(db->rootGroup()->children().at(2) == g6);
|
|
|
|
|
|
|
|
g5->setParent(db->rootGroup());
|
|
|
|
QVERIFY(db->rootGroup()->children().at(1) == g6);
|
|
|
|
QVERIFY(db->rootGroup()->children().at(2) == g5);
|
|
|
|
|
2010-08-23 15:30:20 -04:00
|
|
|
QSignalSpy spy(db, SIGNAL(groupDataChanged(Group*)));
|
2010-08-15 09:03:47 -04:00
|
|
|
g2->setName("test");
|
|
|
|
g4->setName("test");
|
|
|
|
g3->setName("test");
|
|
|
|
g1->setName("test");
|
|
|
|
g3->setIcon(Uuid::random());
|
|
|
|
g1->setIcon(2);
|
2010-08-18 05:05:46 -04:00
|
|
|
QCOMPARE(spy.count(), 6);
|
2011-06-29 12:40:26 -04:00
|
|
|
delete db;
|
|
|
|
|
2011-07-09 15:54:01 -04:00
|
|
|
QVERIFY(rootGroup.isNull());
|
2011-06-29 12:40:26 -04:00
|
|
|
QVERIFY(g1.isNull());
|
|
|
|
QVERIFY(g2.isNull());
|
|
|
|
QVERIFY(g3.isNull());
|
|
|
|
QVERIFY(g4.isNull());
|
|
|
|
delete tmpRoot;
|
2010-08-13 12:08:06 -04:00
|
|
|
}
|
|
|
|
|
2010-08-18 04:27:40 -04:00
|
|
|
void TestGroup::testSignals()
|
|
|
|
{
|
|
|
|
Database* db = new Database();
|
2012-04-23 10:57:08 -04:00
|
|
|
Database* db2 = new Database();
|
2011-07-09 15:54:01 -04:00
|
|
|
QPointer<Group> root = db->rootGroup();
|
2010-08-18 04:27:40 -04:00
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QSignalSpy spyAboutToAdd(db, SIGNAL(groupAboutToAdd(Group*, int)));
|
2010-08-18 04:27:40 -04:00
|
|
|
QSignalSpy spyAdded(db, SIGNAL(groupAdded()));
|
2010-08-23 15:30:20 -04:00
|
|
|
QSignalSpy spyAboutToRemove(db, SIGNAL(groupAboutToRemove(Group*)));
|
2010-08-18 04:27:40 -04:00
|
|
|
QSignalSpy spyRemoved(db, SIGNAL(groupRemoved()));
|
2017-11-27 15:41:58 -05:00
|
|
|
QSignalSpy spyAboutToMove(db, SIGNAL(groupAboutToMove(Group*, Group*, int)));
|
2012-04-23 10:57:08 -04:00
|
|
|
QSignalSpy spyMoved(db, SIGNAL(groupMoved()));
|
2010-08-18 04:27:40 -04:00
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QSignalSpy spyAboutToAdd2(db2, SIGNAL(groupAboutToAdd(Group*, int)));
|
2012-04-23 10:57:08 -04:00
|
|
|
QSignalSpy spyAdded2(db2, SIGNAL(groupAdded()));
|
|
|
|
QSignalSpy spyAboutToRemove2(db2, SIGNAL(groupAboutToRemove(Group*)));
|
|
|
|
QSignalSpy spyRemoved2(db2, SIGNAL(groupRemoved()));
|
2017-11-27 15:41:58 -05:00
|
|
|
QSignalSpy spyAboutToMove2(db2, SIGNAL(groupAboutToMove(Group*, Group*, int)));
|
2012-04-23 10:57:08 -04:00
|
|
|
QSignalSpy spyMoved2(db2, SIGNAL(groupMoved()));
|
|
|
|
|
|
|
|
Group* g1 = new Group();
|
|
|
|
Group* g2 = new Group();
|
2010-08-18 04:27:40 -04:00
|
|
|
|
2012-04-23 10:57:08 -04:00
|
|
|
g1->setParent(root);
|
2010-08-18 04:27:40 -04:00
|
|
|
QCOMPARE(spyAboutToAdd.count(), 1);
|
|
|
|
QCOMPARE(spyAdded.count(), 1);
|
2012-04-23 10:57:08 -04:00
|
|
|
QCOMPARE(spyAboutToRemove.count(), 0);
|
|
|
|
QCOMPARE(spyRemoved.count(), 0);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 0);
|
|
|
|
QCOMPARE(spyMoved.count(), 0);
|
|
|
|
|
|
|
|
g2->setParent(root);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 2);
|
|
|
|
QCOMPARE(spyAdded.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 0);
|
|
|
|
QCOMPARE(spyRemoved.count(), 0);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 0);
|
|
|
|
QCOMPARE(spyMoved.count(), 0);
|
|
|
|
|
2012-04-24 18:10:06 -04:00
|
|
|
g2->setParent(root);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 2);
|
|
|
|
QCOMPARE(spyAdded.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 0);
|
|
|
|
QCOMPARE(spyRemoved.count(), 0);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 0);
|
|
|
|
QCOMPARE(spyMoved.count(), 0);
|
|
|
|
|
2012-04-23 10:57:08 -04:00
|
|
|
g2->setParent(root, 0);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 2);
|
|
|
|
QCOMPARE(spyAdded.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 0);
|
|
|
|
QCOMPARE(spyRemoved.count(), 0);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 1);
|
|
|
|
QCOMPARE(spyMoved.count(), 1);
|
|
|
|
|
|
|
|
g1->setParent(g2);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 2);
|
|
|
|
QCOMPARE(spyAdded.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 0);
|
|
|
|
QCOMPARE(spyRemoved.count(), 0);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 2);
|
|
|
|
QCOMPARE(spyMoved.count(), 2);
|
|
|
|
|
|
|
|
delete g1;
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 2);
|
|
|
|
QCOMPARE(spyAdded.count(), 2);
|
2010-08-18 04:27:40 -04:00
|
|
|
QCOMPARE(spyAboutToRemove.count(), 1);
|
|
|
|
QCOMPARE(spyRemoved.count(), 1);
|
2012-04-23 10:57:08 -04:00
|
|
|
QCOMPARE(spyAboutToMove.count(), 2);
|
|
|
|
QCOMPARE(spyMoved.count(), 2);
|
|
|
|
|
|
|
|
g2->setParent(db2->rootGroup());
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 2);
|
|
|
|
QCOMPARE(spyAdded.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 2);
|
|
|
|
QCOMPARE(spyRemoved.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 2);
|
|
|
|
QCOMPARE(spyMoved.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToAdd2.count(), 1);
|
|
|
|
QCOMPARE(spyAdded2.count(), 1);
|
|
|
|
QCOMPARE(spyAboutToRemove2.count(), 0);
|
|
|
|
QCOMPARE(spyRemoved2.count(), 0);
|
|
|
|
QCOMPARE(spyAboutToMove2.count(), 0);
|
|
|
|
QCOMPARE(spyMoved2.count(), 0);
|
2010-08-18 10:22:48 -04:00
|
|
|
|
2012-04-25 04:17:24 -04:00
|
|
|
Group* g3 = new Group();
|
|
|
|
Group* g4 = new Group();
|
|
|
|
|
|
|
|
g3->setParent(root);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 3);
|
|
|
|
QCOMPARE(spyAdded.count(), 3);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 2);
|
|
|
|
QCOMPARE(spyRemoved.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 2);
|
|
|
|
QCOMPARE(spyMoved.count(), 2);
|
|
|
|
|
|
|
|
g4->setParent(root);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 4);
|
|
|
|
QCOMPARE(spyAdded.count(), 4);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 2);
|
|
|
|
QCOMPARE(spyRemoved.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 2);
|
|
|
|
QCOMPARE(spyMoved.count(), 2);
|
|
|
|
|
|
|
|
g3->setParent(root);
|
|
|
|
QCOMPARE(spyAboutToAdd.count(), 4);
|
|
|
|
QCOMPARE(spyAdded.count(), 4);
|
|
|
|
QCOMPARE(spyAboutToRemove.count(), 2);
|
|
|
|
QCOMPARE(spyRemoved.count(), 2);
|
|
|
|
QCOMPARE(spyAboutToMove.count(), 3);
|
|
|
|
QCOMPARE(spyMoved.count(), 3);
|
|
|
|
|
2010-08-18 10:22:48 -04:00
|
|
|
delete db;
|
2012-04-23 10:57:08 -04:00
|
|
|
delete db2;
|
2011-06-29 12:40:26 -04:00
|
|
|
|
|
|
|
QVERIFY(root.isNull());
|
2010-08-18 10:22:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestGroup::testEntries()
|
|
|
|
{
|
|
|
|
Group* group = new Group();
|
|
|
|
|
2011-06-29 12:40:26 -04:00
|
|
|
QPointer<Entry> entry1 = new Entry();
|
2010-08-18 10:22:48 -04:00
|
|
|
entry1->setGroup(group);
|
|
|
|
|
2011-06-29 12:40:26 -04:00
|
|
|
QPointer<Entry> entry2 = new Entry();
|
2010-08-18 10:22:48 -04:00
|
|
|
entry2->setGroup(group);
|
|
|
|
|
|
|
|
QCOMPARE(group->entries().size(), 2);
|
|
|
|
QVERIFY(group->entries().at(0) == entry1);
|
|
|
|
QVERIFY(group->entries().at(1) == entry2);
|
|
|
|
|
|
|
|
delete group;
|
2011-06-29 12:40:26 -04:00
|
|
|
|
|
|
|
QVERIFY(entry1.isNull());
|
|
|
|
QVERIFY(entry2.isNull());
|
2010-08-18 04:27:40 -04:00
|
|
|
}
|
|
|
|
|
2011-07-09 15:54:01 -04:00
|
|
|
void TestGroup::testDeleteSignals()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
2011-07-09 15:54:01 -04:00
|
|
|
Group* groupRoot = db->rootGroup();
|
|
|
|
Group* groupChild = new Group();
|
|
|
|
Group* groupChildChild = new Group();
|
|
|
|
groupRoot->setObjectName("groupRoot");
|
|
|
|
groupChild->setObjectName("groupChild");
|
|
|
|
groupChildChild->setObjectName("groupChildChild");
|
|
|
|
groupChild->setParent(groupRoot);
|
|
|
|
groupChildChild->setParent(groupChild);
|
2017-11-27 15:41:58 -05:00
|
|
|
QSignalSpy spyAboutToRemove(db.data(), SIGNAL(groupAboutToRemove(Group*)));
|
|
|
|
QSignalSpy spyRemoved(db.data(), SIGNAL(groupRemoved()));
|
2011-07-09 15:54:01 -04:00
|
|
|
|
|
|
|
delete groupChild;
|
|
|
|
QVERIFY(groupRoot->children().isEmpty());
|
2013-03-22 15:57:18 -04:00
|
|
|
QCOMPARE(spyAboutToRemove.count(), 2);
|
|
|
|
QCOMPARE(spyRemoved.count(), 2);
|
2011-07-09 15:54:01 -04:00
|
|
|
|
|
|
|
Group* group = new Group();
|
|
|
|
Entry* entry = new Entry();
|
|
|
|
entry->setGroup(group);
|
|
|
|
QSignalSpy spyEntryAboutToRemove(group, SIGNAL(entryAboutToRemove(Entry*)));
|
2012-07-21 12:19:40 -04:00
|
|
|
QSignalSpy spyEntryRemoved(group, SIGNAL(entryRemoved(Entry*)));
|
2011-07-09 15:54:01 -04:00
|
|
|
|
|
|
|
delete entry;
|
|
|
|
QVERIFY(group->entries().isEmpty());
|
|
|
|
QCOMPARE(spyEntryAboutToRemove.count(), 1);
|
|
|
|
QCOMPARE(spyEntryRemoved.count(), 1);
|
|
|
|
delete group;
|
2012-04-21 17:31:37 -04:00
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> db2(new Database());
|
2012-04-21 17:31:37 -04:00
|
|
|
Group* groupRoot2 = db2->rootGroup();
|
|
|
|
Group* group2 = new Group();
|
|
|
|
group2->setParent(groupRoot2);
|
|
|
|
Entry* entry2 = new Entry();
|
|
|
|
entry2->setGroup(group2);
|
|
|
|
QSignalSpy spyEntryAboutToRemove2(group2, SIGNAL(entryAboutToRemove(Entry*)));
|
2012-07-21 12:19:40 -04:00
|
|
|
QSignalSpy spyEntryRemoved2(group2, SIGNAL(entryRemoved(Entry*)));
|
2012-04-21 17:31:37 -04:00
|
|
|
|
|
|
|
delete group2;
|
2013-03-22 15:57:18 -04:00
|
|
|
QCOMPARE(spyEntryAboutToRemove2.count(), 1);
|
|
|
|
QCOMPARE(spyEntryRemoved2.count(), 1);
|
2011-07-09 15:54:01 -04:00
|
|
|
}
|
|
|
|
|
2012-04-27 05:22:02 -04:00
|
|
|
void TestGroup::testCopyCustomIcon()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> dbSource(new Database());
|
2012-04-27 05:22:02 -04:00
|
|
|
|
|
|
|
Uuid groupIconUuid = Uuid::random();
|
|
|
|
QImage groupIcon(16, 16, QImage::Format_RGB32);
|
|
|
|
groupIcon.setPixel(0, 0, qRgb(255, 0, 0));
|
|
|
|
dbSource->metadata()->addCustomIcon(groupIconUuid, groupIcon);
|
|
|
|
|
|
|
|
Uuid entryIconUuid = Uuid::random();
|
|
|
|
QImage entryIcon(16, 16, QImage::Format_RGB32);
|
|
|
|
entryIcon.setPixel(0, 0, qRgb(255, 0, 0));
|
|
|
|
dbSource->metadata()->addCustomIcon(entryIconUuid, entryIcon);
|
|
|
|
|
|
|
|
Group* group = new Group();
|
|
|
|
group->setParent(dbSource->rootGroup());
|
|
|
|
group->setIcon(groupIconUuid);
|
|
|
|
QCOMPARE(group->icon(), groupIcon);
|
|
|
|
|
|
|
|
Entry* entry = new Entry();
|
|
|
|
entry->setGroup(dbSource->rootGroup());
|
|
|
|
entry->setIcon(entryIconUuid);
|
|
|
|
QCOMPARE(entry->icon(), entryIcon);
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> dbTarget(new Database());
|
2012-04-27 05:22:02 -04:00
|
|
|
|
|
|
|
group->setParent(dbTarget->rootGroup());
|
|
|
|
QVERIFY(dbTarget->metadata()->containsCustomIcon(groupIconUuid));
|
|
|
|
QCOMPARE(dbTarget->metadata()->customIcon(groupIconUuid), groupIcon);
|
|
|
|
QCOMPARE(group->icon(), groupIcon);
|
|
|
|
|
|
|
|
entry->setGroup(dbTarget->rootGroup());
|
|
|
|
QVERIFY(dbTarget->metadata()->containsCustomIcon(entryIconUuid));
|
|
|
|
QCOMPARE(dbTarget->metadata()->customIcon(entryIconUuid), entryIcon);
|
|
|
|
QCOMPARE(entry->icon(), entryIcon);
|
|
|
|
}
|
|
|
|
|
2013-04-04 15:48:55 -04:00
|
|
|
void TestGroup::testClone()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
2013-04-04 15:48:55 -04:00
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Group> originalGroup(new Group());
|
2013-04-04 15:48:55 -04:00
|
|
|
originalGroup->setParent(db->rootGroup());
|
|
|
|
originalGroup->setName("Group");
|
|
|
|
originalGroup->setIcon(42);
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Entry> originalGroupEntry(new Entry());
|
|
|
|
originalGroupEntry->setGroup(originalGroup.data());
|
2013-11-22 07:27:49 -05:00
|
|
|
originalGroupEntry->setTitle("GroupEntryOld");
|
2013-04-04 15:48:55 -04:00
|
|
|
originalGroupEntry->setIcon(43);
|
2013-11-22 07:27:49 -05:00
|
|
|
originalGroupEntry->beginUpdate();
|
|
|
|
originalGroupEntry->setTitle("GroupEntry");
|
|
|
|
originalGroupEntry->endUpdate();
|
2013-04-04 15:48:55 -04:00
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Group> subGroup(new Group());
|
|
|
|
subGroup->setParent(originalGroup.data());
|
2013-04-04 15:48:55 -04:00
|
|
|
subGroup->setName("SubGroup");
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Entry> subGroupEntry(new Entry());
|
|
|
|
subGroupEntry->setGroup(subGroup.data());
|
2013-04-04 15:48:55 -04:00
|
|
|
subGroupEntry->setTitle("SubGroupEntry");
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Group> clonedGroup(originalGroup->clone());
|
2013-04-04 15:48:55 -04:00
|
|
|
QVERIFY(!clonedGroup->parentGroup());
|
|
|
|
QVERIFY(!clonedGroup->database());
|
|
|
|
QVERIFY(clonedGroup->uuid() != originalGroup->uuid());
|
|
|
|
QCOMPARE(clonedGroup->name(), QString("Group"));
|
|
|
|
QCOMPARE(clonedGroup->iconNumber(), 42);
|
|
|
|
QCOMPARE(clonedGroup->children().size(), 1);
|
|
|
|
QCOMPARE(clonedGroup->entries().size(), 1);
|
|
|
|
|
|
|
|
Entry* clonedGroupEntry = clonedGroup->entries().at(0);
|
|
|
|
QVERIFY(clonedGroupEntry->uuid() != originalGroupEntry->uuid());
|
|
|
|
QCOMPARE(clonedGroupEntry->title(), QString("GroupEntry"));
|
|
|
|
QCOMPARE(clonedGroupEntry->iconNumber(), 43);
|
2013-11-22 07:27:49 -05:00
|
|
|
QCOMPARE(clonedGroupEntry->historyItems().size(), 0);
|
2013-04-04 15:48:55 -04:00
|
|
|
|
|
|
|
Group* clonedSubGroup = clonedGroup->children().at(0);
|
|
|
|
QVERIFY(clonedSubGroup->uuid() != subGroup->uuid());
|
|
|
|
QCOMPARE(clonedSubGroup->name(), QString("SubGroup"));
|
|
|
|
QCOMPARE(clonedSubGroup->children().size(), 0);
|
|
|
|
QCOMPARE(clonedSubGroup->entries().size(), 1);
|
|
|
|
|
|
|
|
Entry* clonedSubGroupEntry = clonedSubGroup->entries().at(0);
|
|
|
|
QVERIFY(clonedSubGroupEntry->uuid() != subGroupEntry->uuid());
|
|
|
|
QCOMPARE(clonedSubGroupEntry->title(), QString("SubGroupEntry"));
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Group> clonedGroupKeepUuid(originalGroup->clone(Entry::CloneNoFlags));
|
2016-09-02 05:47:22 -04:00
|
|
|
QCOMPARE(clonedGroupKeepUuid->entries().at(0)->uuid(), originalGroupEntry->uuid());
|
|
|
|
QCOMPARE(clonedGroupKeepUuid->children().at(0)->entries().at(0)->uuid(), subGroupEntry->uuid());
|
|
|
|
|
2017-12-12 23:38:23 -05:00
|
|
|
QScopedPointer<Group> clonedGroupNoFlags(originalGroup->clone(Entry::CloneNoFlags, Group::CloneNoFlags));
|
2017-11-21 14:24:24 -05:00
|
|
|
QCOMPARE(clonedGroupNoFlags->entries().size(), 0);
|
|
|
|
QVERIFY(clonedGroupNoFlags->uuid() == originalGroup->uuid());
|
|
|
|
|
2017-12-12 23:38:23 -05:00
|
|
|
QScopedPointer<Group> clonedGroupNewUuid(originalGroup->clone(Entry::CloneNoFlags, Group::CloneNewUuid));
|
2017-11-21 14:24:24 -05:00
|
|
|
QCOMPARE(clonedGroupNewUuid->entries().size(), 0);
|
|
|
|
QVERIFY(clonedGroupNewUuid->uuid() != originalGroup->uuid());
|
|
|
|
|
|
|
|
// Making sure the new modification date is not the same.
|
|
|
|
QTest::qSleep(1);
|
|
|
|
|
2017-12-12 23:38:23 -05:00
|
|
|
QScopedPointer<Group> clonedGroupResetTimeInfo(originalGroup->clone(Entry::CloneNoFlags,
|
|
|
|
Group::CloneNewUuid | Group::CloneResetTimeInfo));
|
2017-11-21 14:24:24 -05:00
|
|
|
QCOMPARE(clonedGroupResetTimeInfo->entries().size(), 0);
|
|
|
|
QVERIFY(clonedGroupResetTimeInfo->uuid() != originalGroup->uuid());
|
|
|
|
QVERIFY(clonedGroupResetTimeInfo->timeInfo().lastModificationTime() != originalGroup->timeInfo().lastModificationTime());
|
2013-04-04 15:48:55 -04:00
|
|
|
}
|
|
|
|
|
2013-04-07 13:38:18 -04:00
|
|
|
void TestGroup::testCopyCustomIcons()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> dbSource(new Database());
|
|
|
|
QScopedPointer<Database> dbTarget(new Database());
|
2013-04-07 13:38:18 -04:00
|
|
|
|
|
|
|
QImage iconImage1(1, 1, QImage::Format_RGB32);
|
|
|
|
iconImage1.setPixel(0, 0, qRgb(1, 2, 3));
|
|
|
|
|
|
|
|
QImage iconImage2(1, 1, QImage::Format_RGB32);
|
|
|
|
iconImage2.setPixel(0, 0, qRgb(4, 5, 6));
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Group> group1(new Group());
|
2013-04-07 13:38:18 -04:00
|
|
|
group1->setParent(dbSource->rootGroup());
|
|
|
|
Uuid group1Icon = Uuid::random();
|
|
|
|
dbSource->metadata()->addCustomIcon(group1Icon, iconImage1);
|
|
|
|
group1->setIcon(group1Icon);
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Group> group2(new Group());
|
|
|
|
group2->setParent(group1.data());
|
2013-04-07 13:38:18 -04:00
|
|
|
Uuid group2Icon = Uuid::random();
|
|
|
|
dbSource->metadata()->addCustomIcon(group2Icon, iconImage1);
|
|
|
|
group2->setIcon(group2Icon);
|
|
|
|
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Entry> entry1(new Entry());
|
|
|
|
entry1->setGroup(group2.data());
|
2013-04-07 13:38:18 -04:00
|
|
|
Uuid entry1IconOld = Uuid::random();
|
|
|
|
dbSource->metadata()->addCustomIcon(entry1IconOld, iconImage1);
|
|
|
|
entry1->setIcon(entry1IconOld);
|
|
|
|
|
|
|
|
// add history item
|
|
|
|
entry1->beginUpdate();
|
|
|
|
Uuid entry1IconNew = Uuid::random();
|
|
|
|
dbSource->metadata()->addCustomIcon(entry1IconNew, iconImage1);
|
|
|
|
entry1->setIcon(entry1IconNew);
|
|
|
|
entry1->endUpdate();
|
|
|
|
|
|
|
|
// test that we don't overwrite icons
|
|
|
|
dbTarget->metadata()->addCustomIcon(group2Icon, iconImage2);
|
|
|
|
|
|
|
|
dbTarget->metadata()->copyCustomIcons(group1->customIconsRecursive(), dbSource->metadata());
|
|
|
|
|
|
|
|
Metadata* metaTarget = dbTarget->metadata();
|
|
|
|
|
|
|
|
QCOMPARE(metaTarget->customIcons().size(), 4);
|
|
|
|
QVERIFY(metaTarget->containsCustomIcon(group1Icon));
|
|
|
|
QVERIFY(metaTarget->containsCustomIcon(group2Icon));
|
|
|
|
QVERIFY(metaTarget->containsCustomIcon(entry1IconOld));
|
|
|
|
QVERIFY(metaTarget->containsCustomIcon(entry1IconNew));
|
|
|
|
|
|
|
|
QCOMPARE(metaTarget->customIcon(group1Icon).pixel(0, 0), qRgb(1, 2, 3));
|
|
|
|
QCOMPARE(metaTarget->customIcon(group2Icon).pixel(0, 0), qRgb(4, 5, 6));
|
|
|
|
}
|
2016-11-07 22:37:42 -05:00
|
|
|
|
2017-05-19 14:04:11 -04:00
|
|
|
void TestGroup::testFindEntry()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
2017-05-19 14:04:11 -04:00
|
|
|
|
|
|
|
Entry* entry1 = new Entry();
|
|
|
|
entry1->setTitle(QString("entry1"));
|
|
|
|
entry1->setGroup(db->rootGroup());
|
|
|
|
entry1->setUuid(Uuid::random());
|
|
|
|
|
|
|
|
Group* group1 = new Group();
|
|
|
|
group1->setName("group1");
|
|
|
|
|
|
|
|
Entry* entry2 = new Entry();
|
|
|
|
|
|
|
|
entry2->setTitle(QString("entry2"));
|
|
|
|
entry2->setGroup(group1);
|
|
|
|
entry2->setUuid(Uuid::random());
|
|
|
|
|
|
|
|
group1->setParent(db->rootGroup());
|
|
|
|
|
|
|
|
Entry* entry;
|
|
|
|
|
|
|
|
entry = db->rootGroup()->findEntry(entry1->uuid().toHex());
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry1"));
|
|
|
|
|
|
|
|
entry = db->rootGroup()->findEntry(QString("entry1"));
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry1"));
|
|
|
|
|
2017-06-21 17:34:49 -04:00
|
|
|
// We also can find the entry with the leading slash.
|
|
|
|
entry = db->rootGroup()->findEntry(QString("/entry1"));
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry1"));
|
|
|
|
|
|
|
|
// But two slashes should not be accepted.
|
|
|
|
entry = db->rootGroup()->findEntry(QString("//entry1"));
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
2017-05-19 14:04:11 -04:00
|
|
|
entry = db->rootGroup()->findEntry(entry2->uuid().toHex());
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry2"));
|
|
|
|
|
|
|
|
entry = db->rootGroup()->findEntry(QString("group1/entry2"));
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry2"));
|
|
|
|
|
2017-06-21 17:34:49 -04:00
|
|
|
entry = db->rootGroup()->findEntry(QString("/entry2"));
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
|
|
|
// We also can find the entry with the leading slash.
|
|
|
|
entry = db->rootGroup()->findEntry(QString("/group1/entry2"));
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry2"));
|
|
|
|
|
2017-05-21 13:51:16 -04:00
|
|
|
// Should also find the entry only by title.
|
|
|
|
entry = db->rootGroup()->findEntry(QString("entry2"));
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QCOMPARE(entry->title(), QString("entry2"));
|
|
|
|
|
2017-05-19 14:04:11 -04:00
|
|
|
entry = db->rootGroup()->findEntry(QString("invalid/path/to/entry2"));
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
2017-05-21 13:51:16 -04:00
|
|
|
entry = db->rootGroup()->findEntry(QString("entry27"));
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
2017-05-19 14:04:11 -04:00
|
|
|
// A valid UUID that does not exist in this database.
|
|
|
|
entry = db->rootGroup()->findEntry(QString("febfb01ebcdf9dbd90a3f1579dc75281"));
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
|
|
|
// An invalid UUID.
|
|
|
|
entry = db->rootGroup()->findEntry(QString("febfb01ebcdf9dbd90a3f1579dc"));
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
}
|
2017-05-21 13:05:44 -04:00
|
|
|
|
2017-06-21 17:34:49 -04:00
|
|
|
void TestGroup::testFindGroupByPath()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
2017-06-21 17:34:49 -04:00
|
|
|
|
|
|
|
Group* group1 = new Group();
|
|
|
|
group1->setName("group1");
|
|
|
|
group1->setParent(db->rootGroup());
|
|
|
|
|
|
|
|
Group* group2 = new Group();
|
|
|
|
group2->setName("group2");
|
|
|
|
group2->setParent(group1);
|
|
|
|
|
|
|
|
Group* group;
|
|
|
|
|
|
|
|
group = db->rootGroup()->findGroupByPath("/");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), db->rootGroup()->uuid());
|
|
|
|
|
|
|
|
// We also accept it if the leading slash is missing.
|
|
|
|
group = db->rootGroup()->findGroupByPath("");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), db->rootGroup()->uuid());
|
|
|
|
|
|
|
|
group = db->rootGroup()->findGroupByPath("/group1/");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), group1->uuid());
|
|
|
|
|
|
|
|
// We also accept it if the leading slash is missing.
|
|
|
|
group = db->rootGroup()->findGroupByPath("group1/");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), group1->uuid());
|
|
|
|
|
|
|
|
// Too many slashes at the end
|
|
|
|
group = db->rootGroup()->findGroupByPath("group1//");
|
|
|
|
QVERIFY(group == nullptr);
|
|
|
|
|
|
|
|
// Missing a slash at the end.
|
|
|
|
group = db->rootGroup()->findGroupByPath("/group1");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), group1->uuid());
|
|
|
|
|
|
|
|
// Too many slashes at the start
|
|
|
|
group = db->rootGroup()->findGroupByPath("//group1");
|
|
|
|
QVERIFY(group == nullptr);
|
|
|
|
|
|
|
|
group = db->rootGroup()->findGroupByPath("/group1/group2/");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), group2->uuid());
|
|
|
|
|
|
|
|
// We also accept it if the leading slash is missing.
|
|
|
|
group = db->rootGroup()->findGroupByPath("group1/group2/");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), group2->uuid());
|
|
|
|
|
|
|
|
group = db->rootGroup()->findGroupByPath("group1/group2");
|
|
|
|
QVERIFY(group != nullptr);
|
|
|
|
QCOMPARE(group->uuid(), group2->uuid());
|
|
|
|
|
|
|
|
group = db->rootGroup()->findGroupByPath("invalid");
|
|
|
|
QVERIFY(group == nullptr);
|
|
|
|
}
|
|
|
|
|
2017-05-21 13:05:44 -04:00
|
|
|
void TestGroup::testPrint()
|
|
|
|
{
|
2017-11-27 15:41:58 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
2017-05-21 13:05:44 -04:00
|
|
|
|
|
|
|
QString output = db->rootGroup()->print();
|
|
|
|
QCOMPARE(output, QString("[empty]\n"));
|
|
|
|
|
|
|
|
output = db->rootGroup()->print(true);
|
|
|
|
QCOMPARE(output, QString("[empty]\n"));
|
|
|
|
|
|
|
|
Entry* entry1 = new Entry();
|
|
|
|
entry1->setTitle(QString("entry1"));
|
|
|
|
entry1->setGroup(db->rootGroup());
|
|
|
|
entry1->setUuid(Uuid::random());
|
|
|
|
|
|
|
|
output = db->rootGroup()->print();
|
|
|
|
QCOMPARE(output, QString("entry1\n"));
|
|
|
|
|
|
|
|
Group* group1 = new Group();
|
|
|
|
group1->setName("group1");
|
|
|
|
|
|
|
|
Entry* entry2 = new Entry();
|
|
|
|
|
|
|
|
entry2->setTitle(QString("entry2"));
|
|
|
|
entry2->setGroup(group1);
|
|
|
|
entry2->setUuid(Uuid::random());
|
|
|
|
|
|
|
|
group1->setParent(db->rootGroup());
|
|
|
|
|
|
|
|
output = db->rootGroup()->print();
|
|
|
|
QVERIFY(output.contains(QString("entry1\n")));
|
|
|
|
QVERIFY(output.contains(QString("group1/\n")));
|
2017-07-17 15:16:53 -04:00
|
|
|
QVERIFY(!output.contains(QString(" entry2\n")));
|
2017-05-21 13:05:44 -04:00
|
|
|
|
|
|
|
output = db->rootGroup()->print(true);
|
2017-07-17 15:16:53 -04:00
|
|
|
QVERIFY(output.contains(QString("entry1\n")));
|
|
|
|
QVERIFY(output.contains(QString("group1/\n")));
|
|
|
|
QVERIFY(output.contains(QString(" entry2\n")));
|
|
|
|
|
|
|
|
output = group1->print();
|
|
|
|
QVERIFY(!output.contains(QString("group1/\n")));
|
|
|
|
QVERIFY(output.contains(QString("entry2\n")));
|
2017-05-21 13:05:44 -04:00
|
|
|
}
|
2017-08-05 12:20:26 -04:00
|
|
|
|
|
|
|
void TestGroup::testLocate()
|
|
|
|
{
|
|
|
|
Database* db = new Database();
|
|
|
|
|
|
|
|
Entry* entry1 = new Entry();
|
|
|
|
entry1->setTitle("entry1");
|
|
|
|
entry1->setGroup(db->rootGroup());
|
|
|
|
|
|
|
|
Entry* entry2 = new Entry();
|
|
|
|
entry2->setTitle("entry2");
|
|
|
|
entry2->setGroup(db->rootGroup());
|
|
|
|
|
|
|
|
Group* group1 = new Group();
|
|
|
|
group1->setName("group1");
|
|
|
|
group1->setParent(db->rootGroup());
|
|
|
|
|
|
|
|
Group* group2 = new Group();
|
|
|
|
group2->setName("group2");
|
|
|
|
group2->setParent(group1);
|
|
|
|
|
|
|
|
Entry* entry3 = new Entry();
|
|
|
|
entry3->setTitle("entry3");
|
|
|
|
entry3->setGroup(group1);
|
|
|
|
|
|
|
|
Entry* entry43 = new Entry();
|
|
|
|
entry43->setTitle("entry43");
|
|
|
|
entry43->setGroup(group1);
|
|
|
|
|
|
|
|
Entry* google = new Entry();
|
|
|
|
google->setTitle("Google");
|
|
|
|
google->setGroup(group2);
|
|
|
|
|
|
|
|
QStringList results = db->rootGroup()->locate("entry");
|
|
|
|
QVERIFY(results.size() == 4);
|
|
|
|
QVERIFY(results.contains("/group1/entry43"));
|
|
|
|
|
|
|
|
results = db->rootGroup()->locate("entry1");
|
|
|
|
QVERIFY(results.size() == 1);
|
|
|
|
QVERIFY(results.contains("/entry1"));
|
|
|
|
|
|
|
|
results = db->rootGroup()->locate("Entry1");
|
|
|
|
QVERIFY(results.size() == 1);
|
|
|
|
QVERIFY(results.contains("/entry1"));
|
|
|
|
|
|
|
|
results = db->rootGroup()->locate("invalid");
|
|
|
|
QVERIFY(results.size() == 0);
|
|
|
|
|
|
|
|
results = db->rootGroup()->locate("google");
|
|
|
|
QVERIFY(results.size() == 1);
|
|
|
|
QVERIFY(results.contains("/group1/group2/Google"));
|
|
|
|
|
|
|
|
results = db->rootGroup()->locate("group1");
|
|
|
|
QVERIFY(results.size() == 3);
|
|
|
|
QVERIFY(results.contains("/group1/entry3"));
|
|
|
|
QVERIFY(results.contains("/group1/entry43"));
|
|
|
|
QVERIFY(results.contains("/group1/group2/Google"));
|
|
|
|
|
|
|
|
delete db;
|
|
|
|
}
|
2017-09-06 09:14:41 -04:00
|
|
|
|
|
|
|
void TestGroup::testAddEntryWithPath()
|
|
|
|
{
|
|
|
|
Database* db = new Database();
|
|
|
|
|
|
|
|
Group* group1 = new Group();
|
|
|
|
group1->setName("group1");
|
|
|
|
group1->setParent(db->rootGroup());
|
|
|
|
|
|
|
|
Group* group2 = new Group();
|
|
|
|
group2->setName("group2");
|
|
|
|
group2->setParent(group1);
|
|
|
|
|
|
|
|
Entry* entry = db->rootGroup()->addEntryWithPath("entry1");
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QVERIFY(!entry->uuid().isNull());
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("entry1");
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("/entry1");
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("entry2");
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QVERIFY(entry->title() == "entry2");
|
|
|
|
QVERIFY(!entry->uuid().isNull());
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("/entry3");
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QVERIFY(entry->title() == "entry3");
|
|
|
|
QVERIFY(!entry->uuid().isNull());
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("/group1/entry4");
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QVERIFY(entry->title() == "entry4");
|
|
|
|
QVERIFY(!entry->uuid().isNull());
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("/group1/group2/entry5");
|
|
|
|
QVERIFY(entry != nullptr);
|
|
|
|
QVERIFY(entry->title() == "entry5");
|
|
|
|
QVERIFY(!entry->uuid().isNull());
|
|
|
|
|
|
|
|
entry = db->rootGroup()->addEntryWithPath("/group1/invalid_group/entry6");
|
|
|
|
QVERIFY(entry == nullptr);
|
|
|
|
|
|
|
|
delete db;
|
|
|
|
}
|