2012-04-18 07:27:16 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "TestModified.h"
|
2018-10-19 14:22:28 -04:00
|
|
|
#include "mock/MockClock.h"
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2013-10-03 09:18:16 -04:00
|
|
|
#include <QSignalSpy>
|
|
|
|
#include <QTest>
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-09-30 08:45:06 -04:00
|
|
|
#include "core/Clock.h"
|
2012-04-18 07:27:16 -04:00
|
|
|
#include "core/Database.h"
|
|
|
|
#include "core/Group.h"
|
2012-05-11 05:04:20 -04:00
|
|
|
#include "core/Metadata.h"
|
2012-04-18 07:27:16 -04:00
|
|
|
#include "crypto/Crypto.h"
|
|
|
|
|
2014-05-16 06:32:52 -04:00
|
|
|
QTEST_GUILESS_MAIN(TestModified)
|
|
|
|
|
2018-09-30 08:45:06 -04:00
|
|
|
namespace
|
|
|
|
{
|
2018-10-19 14:22:28 -04:00
|
|
|
MockClock* m_clock = nullptr;
|
2018-09-30 08:45:06 -04:00
|
|
|
}
|
|
|
|
|
2012-04-18 07:27:16 -04:00
|
|
|
void TestModified::initTestCase()
|
|
|
|
{
|
2014-06-15 05:17:40 -04:00
|
|
|
QVERIFY(Crypto::init());
|
2012-04-18 07:27:16 -04:00
|
|
|
}
|
|
|
|
|
2018-09-30 08:45:06 -04:00
|
|
|
void TestModified::init()
|
|
|
|
{
|
|
|
|
Q_ASSERT(m_clock == nullptr);
|
2018-10-19 14:22:28 -04:00
|
|
|
m_clock = new MockClock(2010, 5, 5, 10, 30, 10);
|
|
|
|
MockClock::setup(m_clock);
|
2018-09-30 08:45:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestModified::cleanup()
|
|
|
|
{
|
2018-10-19 14:22:28 -04:00
|
|
|
MockClock::teardown();
|
2018-09-30 08:45:06 -04:00
|
|
|
m_clock = nullptr;
|
|
|
|
}
|
|
|
|
|
2012-04-18 07:27:16 -04:00
|
|
|
void TestModified::testSignals()
|
|
|
|
{
|
|
|
|
int spyCount = 0;
|
|
|
|
int spyCount2 = 0;
|
|
|
|
|
2018-05-13 17:21:43 -04:00
|
|
|
auto compositeKey = QSharedPointer<CompositeKey>::create();
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
|
|
|
auto* root = db->rootGroup();
|
2018-11-22 05:47:31 -05:00
|
|
|
QSignalSpy spyModified(db.data(), SIGNAL(databaseModified()));
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2012-04-18 11:26:32 -04:00
|
|
|
db->setKey(compositeKey);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group1 = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group1->setParent(root);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group2 = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group2->setParent(root);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 14:39:54 -05:00
|
|
|
group2->setParent(root, 0);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-23 10:57:08 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* entry1 = new Entry();
|
2018-02-18 14:39:54 -05:00
|
|
|
entry1->setGroup(group1);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
QScopedPointer<Database> db2(new Database());
|
|
|
|
auto* root2 = db2->rootGroup();
|
2018-11-22 05:47:31 -05:00
|
|
|
QSignalSpy spyModified2(db2.data(), SIGNAL(databaseModified()));
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 14:39:54 -05:00
|
|
|
group1->setParent(root2);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
|
|
|
++spyCount2;
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2012-04-18 09:16:38 -04:00
|
|
|
entry1->setTitle("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
|
|
|
++spyCount2;
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 09:16:38 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* entry2 = new Entry();
|
2018-02-18 14:39:54 -05:00
|
|
|
entry2->setGroup(group2);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry2->setGroup(root2);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
|
|
|
++spyCount2;
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2012-04-18 10:38:10 -04:00
|
|
|
entry2->setTitle("test2");
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
|
|
|
++spyCount2;
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 10:38:10 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group3 = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group3->setParent(root);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group4 = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group4->setParent(group3);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 14:39:54 -05:00
|
|
|
delete group4;
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 11:31:05 -04:00
|
|
|
|
|
|
|
delete entry2;
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount2;
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 11:31:05 -04:00
|
|
|
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
|
|
|
QTRY_COMPARE(spyModified2.count(), spyCount2);
|
2012-04-18 07:27:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestModified::testGroupSets()
|
|
|
|
{
|
|
|
|
int spyCount = 0;
|
2018-02-18 15:01:22 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
|
|
|
auto* root = db->rootGroup();
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setParent(root);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-11-22 05:47:31 -05:00
|
|
|
QSignalSpy spyModified(db.data(), SIGNAL(databaseModified()));
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-03-22 17:56:05 -04:00
|
|
|
root->setUuid(QUuid::createUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
root->setUuid(root->uuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
root->setName("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
root->setName(root->name());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
root->setNotes("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
root->setNotes(root->notes());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
root->setIcon(1);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
root->setIcon(root->iconNumber());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-03-22 17:56:05 -04:00
|
|
|
root->setIcon(QUuid::createUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
root->setIcon(root->iconUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-03-22 17:56:05 -04:00
|
|
|
group->setUuid(QUuid::createUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setUuid(group->uuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setName("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setName(group->name());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setNotes("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setNotes(group->notes());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setIcon(1);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setIcon(group->iconNumber());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-03-22 17:56:05 -04:00
|
|
|
group->setIcon(QUuid::createUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setIcon(group->iconUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestModified::testEntrySets()
|
|
|
|
{
|
|
|
|
int spyCount = 0;
|
2018-02-18 15:01:22 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
|
|
|
auto* root = db->rootGroup();
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setParent(root);
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* entry = new Entry();
|
2018-02-18 14:39:54 -05:00
|
|
|
entry->setGroup(group);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-11-22 05:47:31 -05:00
|
|
|
QSignalSpy spyModified(db.data(), SIGNAL(databaseModified()));
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-03-22 17:56:05 -04:00
|
|
|
entry->setUuid(QUuid::createUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setUuid(entry->uuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setTitle("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setTitle(entry->title());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setUrl("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setUrl(entry->url());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setUsername("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setUsername(entry->username());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setPassword("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setPassword(entry->password());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setNotes("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setNotes(entry->notes());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setIcon(1);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setIcon(entry->iconNumber());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-03-22 17:56:05 -04:00
|
|
|
entry->setIcon(QUuid::createUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setIcon(entry->iconUuid());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setTags("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setTags(entry->tags());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setExpires(true);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setExpires(entry->timeInfo().expires());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
2018-09-30 08:45:06 -04:00
|
|
|
entry->setExpiryTime(Clock::currentDateTimeUtc().addYears(1));
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setExpiryTime(entry->timeInfo().expiryTime());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setAutoTypeEnabled(false);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setAutoTypeEnabled(entry->autoTypeEnabled());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setAutoTypeObfuscation(1);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setAutoTypeObfuscation(entry->autoTypeObfuscation());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setDefaultAutoTypeSequence("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setDefaultAutoTypeSequence(entry->defaultAutoTypeSequence());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setForegroundColor(Qt::red);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setForegroundColor(entry->foregroundColor());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setBackgroundColor(Qt::red);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setBackgroundColor(entry->backgroundColor());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->setOverrideUrl("test");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->setOverrideUrl(entry->overrideUrl());
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->attributes()->set("test key", "test value", false);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->attributes()->set("test key", entry->attributes()->value("test key"), false);
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->attributes()->set("test key", entry->attributes()->value("test key"), true);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->attributes()->set("test key", "new test value", true);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
|
|
|
|
entry->attributes()->set("test key2", "test value2", true);
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
entry->attributes()->set("test key2", entry->attributes()->value("test key2"), true);
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2012-04-18 07:27:16 -04:00
|
|
|
}
|
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
void TestModified::testHistoryItems()
|
2012-04-23 15:06:04 -04:00
|
|
|
{
|
2018-01-22 20:31:29 -05:00
|
|
|
QScopedPointer<Entry> entry(new Entry());
|
2012-04-23 15:06:04 -04:00
|
|
|
QDateTime created = entry->timeInfo().creationTime();
|
2018-03-22 17:56:05 -04:00
|
|
|
entry->setUuid(QUuid::createUuid());
|
2012-04-23 15:06:04 -04:00
|
|
|
entry->setTitle("a");
|
|
|
|
entry->setTags("a");
|
2018-01-22 20:31:29 -05:00
|
|
|
QScopedPointer<EntryAttributes> attributes(new EntryAttributes());
|
2012-04-23 15:06:04 -04:00
|
|
|
attributes->copyCustomKeysFrom(entry->attributes());
|
|
|
|
|
|
|
|
int historyItemsSize = 0;
|
|
|
|
|
|
|
|
entry->beginUpdate();
|
|
|
|
entry->setTitle("a");
|
|
|
|
entry->setTags("a");
|
|
|
|
entry->setOverrideUrl("");
|
|
|
|
entry->endUpdate();
|
|
|
|
QCOMPARE(entry->historyItems().size(), historyItemsSize);
|
|
|
|
|
|
|
|
QDateTime modified = entry->timeInfo().lastModificationTime();
|
2018-09-30 08:45:06 -04:00
|
|
|
m_clock->advanceSecond(10);
|
2012-04-23 15:06:04 -04:00
|
|
|
entry->beginUpdate();
|
|
|
|
entry->setTitle("b");
|
|
|
|
entry->endUpdate();
|
|
|
|
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
|
2018-03-31 16:01:30 -04:00
|
|
|
auto* historyEntry = entry->historyItems().at(historyItemsSize - 1);
|
2012-04-23 15:06:04 -04:00
|
|
|
QCOMPARE(historyEntry->title(), QString("a"));
|
|
|
|
QCOMPARE(historyEntry->uuid(), entry->uuid());
|
|
|
|
QCOMPARE(historyEntry->tags(), entry->tags());
|
|
|
|
QCOMPARE(historyEntry->overrideUrl(), entry->overrideUrl());
|
|
|
|
QCOMPARE(historyEntry->timeInfo().creationTime(), created);
|
|
|
|
QCOMPARE(historyEntry->timeInfo().lastModificationTime(), modified);
|
2012-05-11 05:04:20 -04:00
|
|
|
QCOMPARE(historyEntry->historyItems().size(), 0);
|
2012-04-23 15:06:04 -04:00
|
|
|
|
|
|
|
entry->beginUpdate();
|
|
|
|
entry->setTags("b");
|
|
|
|
entry->endUpdate();
|
|
|
|
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
|
|
|
|
QCOMPARE(entry->historyItems().at(historyItemsSize - 1)->tags(), QString("a"));
|
|
|
|
|
|
|
|
entry->beginUpdate();
|
|
|
|
entry->attachments()->set("test", QByteArray("value"));
|
|
|
|
entry->endUpdate();
|
|
|
|
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
|
|
|
|
QCOMPARE(entry->historyItems().at(historyItemsSize - 1)->attachments()->keys().size(), 0);
|
|
|
|
|
|
|
|
attributes->set("k", "myvalue");
|
|
|
|
entry->beginUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
entry->attributes()->copyCustomKeysFrom(attributes.data());
|
2012-04-23 15:06:04 -04:00
|
|
|
entry->endUpdate();
|
|
|
|
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
|
|
|
|
QVERIFY(!entry->historyItems().at(historyItemsSize - 1)->attributes()->keys().contains("k"));
|
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* root = db->rootGroup();
|
2012-05-11 05:04:20 -04:00
|
|
|
db->metadata()->setHistoryMaxItems(3);
|
|
|
|
db->metadata()->setHistoryMaxSize(-1);
|
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* entry2 = new Entry();
|
2012-05-11 05:04:20 -04:00
|
|
|
entry2->setGroup(root);
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("1");
|
|
|
|
entry2->endUpdate();
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("2");
|
|
|
|
entry2->endUpdate();
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("3");
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 3);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("4");
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 3);
|
|
|
|
|
|
|
|
db->metadata()->setHistoryMaxItems(1);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("5");
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* historyEntry2 = entry2->historyItems().at(0);
|
2012-05-11 05:04:20 -04:00
|
|
|
QCOMPARE(historyEntry2->title(), QString("4"));
|
|
|
|
|
|
|
|
db->metadata()->setHistoryMaxItems(-1);
|
|
|
|
|
|
|
|
for (int i = 0; i < 20; i++) {
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("6");
|
|
|
|
entry2->endUpdate();
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("6b");
|
|
|
|
entry2->endUpdate();
|
|
|
|
}
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 41);
|
|
|
|
|
|
|
|
db->metadata()->setHistoryMaxItems(0);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("7");
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
const int historyMaxSize = 19000;
|
2018-01-16 02:34:56 -05:00
|
|
|
|
2012-05-11 05:04:20 -04:00
|
|
|
db->metadata()->setHistoryMaxItems(-1);
|
2018-01-16 02:34:56 -05:00
|
|
|
db->metadata()->setHistoryMaxSize(historyMaxSize);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
const QString key("test");
|
2012-05-11 05:04:20 -04:00
|
|
|
entry2->beginUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
entry2->attachments()->set(key, QByteArray(18000, 'X'));
|
2012-05-11 05:04:20 -04:00
|
|
|
entry2->endUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 18000 + key.size());
|
2012-05-11 05:04:20 -04:00
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
|
|
|
|
|
|
|
historyEntry2 = entry2->historyItems().at(0);
|
|
|
|
QCOMPARE(historyEntry2->title(), QString("7"));
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTitle("8");
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 2);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
entry2->attachments()->remove(key);
|
2012-05-11 05:04:20 -04:00
|
|
|
entry2->endUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 0);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set("test2", QByteArray(6000, 'a'));
|
|
|
|
entry2->endUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 6000 + key.size() + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 2);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set("test3", QByteArray(6000, 'b'));
|
|
|
|
entry2->endUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 12000 + (key.size() + 1) * 2);
|
2012-05-11 05:04:20 -04:00
|
|
|
QCOMPARE(entry2->historyItems().size(), 2);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set("test4", QByteArray(6000, 'c'));
|
|
|
|
entry2->endUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 18000 + (key.size() + 1) * 3);
|
2012-05-11 05:04:20 -04:00
|
|
|
QCOMPARE(entry2->historyItems().size(), 3);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set("test5", QByteArray(6000, 'd'));
|
|
|
|
entry2->endUpdate();
|
2018-01-22 20:31:29 -05:00
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 24000 + (key.size() + 1) * 4);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestModified::testHistoryMaxSize()
|
|
|
|
{
|
|
|
|
QScopedPointer<Database> db(new Database());
|
|
|
|
const QString key("test");
|
2012-05-11 05:04:20 -04:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
auto entry1 = new Entry();
|
|
|
|
entry1->setGroup(db->rootGroup());
|
|
|
|
QCOMPARE(entry1->historyItems().size(), 0);
|
|
|
|
|
|
|
|
const int reservedSize1 = entry1->attributes()->attributesSize();
|
|
|
|
db->metadata()->setHistoryMaxItems(-1);
|
|
|
|
db->metadata()->setHistoryMaxSize(18000 + key.size() * 3 + reservedSize1 * 4);
|
|
|
|
|
|
|
|
entry1->beginUpdate();
|
|
|
|
entry1->attachments()->set(key, QByteArray(6000, 'a'));
|
|
|
|
entry1->endUpdate();
|
|
|
|
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
|
|
|
|
QCOMPARE(entry1->historyItems().size(), 1);
|
|
|
|
|
|
|
|
entry1->beginUpdate();
|
|
|
|
entry1->attachments()->set(key, QByteArray(6000, 'b'));
|
|
|
|
entry1->endUpdate();
|
|
|
|
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
|
|
|
|
QCOMPARE(entry1->historyItems().size(), 2);
|
|
|
|
|
|
|
|
entry1->beginUpdate();
|
|
|
|
entry1->attachments()->set(key, QByteArray(6000, 'c'));
|
|
|
|
entry1->endUpdate();
|
|
|
|
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
|
|
|
|
QCOMPARE(entry1->historyItems().size(), 3);
|
|
|
|
|
|
|
|
entry1->beginUpdate();
|
|
|
|
entry1->attachments()->set(key, QByteArray(6000, 'd'));
|
|
|
|
entry1->endUpdate();
|
|
|
|
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
|
|
|
|
QCOMPARE(entry1->historyItems().size(), 4);
|
|
|
|
|
|
|
|
auto entry2 = new Entry();
|
|
|
|
entry2->setGroup(db->rootGroup());
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
|
|
|
const int historyMaxSize = 17000;
|
|
|
|
const int reservedSize2 = entry2->attributes()->attributesSize();
|
|
|
|
db->metadata()->setHistoryMaxSize(historyMaxSize);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), historyMaxSize - reservedSize2 + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
// history size overflow
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'b'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->remove(key);
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 0);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
2012-05-11 05:04:20 -04:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), historyMaxSize - reservedSize2 + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
2018-01-15 12:17:56 -05:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
// history size overflow
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'b'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
2018-01-16 02:34:56 -05:00
|
|
|
|
2018-01-22 20:31:29 -05:00
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attachments()->remove(key);
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attachments()->attachmentsSize(), 0);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTags(QByteArray(historyMaxSize - reservedSize2 + 1, 'a'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->tags().size(), historyMaxSize - reservedSize2 + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
|
|
|
|
|
|
|
// history size overflow
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTags(QByteArray(historyMaxSize - reservedSize2 + 1, 'b'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->setTags("");
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attributes()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attributes()->attributesSize(), historyMaxSize + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
|
|
|
|
|
|
|
// history size overflow
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attributes()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'b'));
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attributes()->attributesSize(), historyMaxSize + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->attributes()->remove(key);
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->attributes()->attributesSize(), reservedSize2);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
2018-01-15 12:17:56 -05:00
|
|
|
AutoTypeAssociations::Association association;
|
2018-01-16 02:34:56 -05:00
|
|
|
association.window = key;
|
2018-01-22 20:31:29 -05:00
|
|
|
association.sequence = QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a');
|
|
|
|
entry2->autoTypeAssociations()->add(association);
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->autoTypeAssociations()->associationsSize(), historyMaxSize - reservedSize2 + 1);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 1);
|
|
|
|
|
|
|
|
entry2->beginUpdate();
|
|
|
|
entry2->autoTypeAssociations()->remove(0);
|
|
|
|
entry2->endUpdate();
|
|
|
|
QCOMPARE(entry2->autoTypeAssociations()->associationsSize(), 0);
|
|
|
|
QCOMPARE(entry2->historyItems().size(), 0);
|
2012-04-23 15:06:04 -04:00
|
|
|
}
|
2018-02-18 14:39:54 -05:00
|
|
|
|
|
|
|
void TestModified::testCustomData()
|
|
|
|
{
|
|
|
|
int spyCount = 0;
|
2018-02-18 15:01:22 -05:00
|
|
|
QScopedPointer<Database> db(new Database());
|
|
|
|
auto* root = db->rootGroup();
|
2018-02-18 14:39:54 -05:00
|
|
|
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* group = new Group();
|
2018-02-18 14:39:54 -05:00
|
|
|
group->setParent(root);
|
2018-02-18 15:01:22 -05:00
|
|
|
auto* entry = new Entry();
|
2018-02-18 14:39:54 -05:00
|
|
|
entry->setGroup(group);
|
|
|
|
|
2018-11-22 05:47:31 -05:00
|
|
|
QSignalSpy spyModified(db.data(), SIGNAL(databaseModified()));
|
2018-02-18 14:39:54 -05:00
|
|
|
|
|
|
|
db->metadata()->customData()->set("Key", "Value");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
db->metadata()->customData()->set("Key", "Value");
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
|
|
|
|
entry->customData()->set("Key", "Value");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
entry->customData()->set("Key", "Value");
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
|
|
|
|
group->customData()->set("Key", "Value");
|
2018-11-22 05:47:31 -05:00
|
|
|
++spyCount;
|
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
group->customData()->set("Key", "Value");
|
2018-11-22 05:47:31 -05:00
|
|
|
QTRY_COMPARE(spyModified.count(), spyCount);
|
2018-02-18 14:39:54 -05:00
|
|
|
}
|