18
#include "TestModified.h"
19
#include "mock/MockClock.h"
24
#include "core/Group.h"
25
#include "core/Metadata.h"
26
#include "crypto/Crypto.h"
28
QTEST_GUILESS_MAIN(TestModified)
32
MockClock* m_clock = nullptr;
35
void TestModified::initTestCase()
37
QVERIFY(Crypto::init());
40
void TestModified::init()
42
Q_ASSERT(m_clock == nullptr);
43
m_clock = new MockClock(2010, 5, 5, 10, 30, 10);
44
MockClock::setup(m_clock);
47
void TestModified::cleanup()
49
MockClock::teardown();
53
void TestModified::testSignals()
58
auto compositeKey = QSharedPointer<CompositeKey>::create();
60
QScopedPointer<Database> db(new Database());
61
auto* root = db->rootGroup();
62
QSignalSpy spyModified(db.data(), SIGNAL(modified()));
64
db->setKey(compositeKey);
66
QTRY_COMPARE(spyModified.count(), spyCount);
68
auto* group1 = new Group();
69
group1->setParent(root);
71
QTRY_COMPARE(spyModified.count(), spyCount);
73
auto* group2 = new Group();
74
group2->setParent(root);
76
QTRY_COMPARE(spyModified.count(), spyCount);
78
group2->setParent(root, 0);
80
QTRY_COMPARE(spyModified.count(), spyCount);
82
auto* entry1 = new Entry();
83
entry1->setGroup(group1);
85
QTRY_COMPARE(spyModified.count(), spyCount);
87
QScopedPointer<Database> db2(new Database());
88
auto* root2 = db2->rootGroup();
89
QSignalSpy spyModified2(db2.data(), SIGNAL(modified()));
91
group1->setParent(root2);
93
QTRY_COMPARE(spyModified.count(), spyCount);
95
QTRY_COMPARE(spyModified2.count(), spyCount2);
97
entry1->setTitle("test");
98
QTRY_COMPARE(spyModified.count(), spyCount);
100
QTRY_COMPARE(spyModified2.count(), spyCount2);
102
auto* entry2 = new Entry();
103
entry2->setGroup(group2);
105
QTRY_COMPARE(spyModified.count(), spyCount);
106
QTRY_COMPARE(spyModified2.count(), spyCount2);
108
entry2->setGroup(root2);
110
QTRY_COMPARE(spyModified.count(), spyCount);
112
QTRY_COMPARE(spyModified2.count(), spyCount2);
114
entry2->setTitle("test2");
115
QTRY_COMPARE(spyModified.count(), spyCount);
117
QTRY_COMPARE(spyModified2.count(), spyCount2);
119
auto* group3 = new Group();
120
group3->setParent(root);
122
QTRY_COMPARE(spyModified.count(), spyCount);
124
auto* group4 = new Group();
125
group4->setParent(group3);
127
QTRY_COMPARE(spyModified.count(), spyCount);
131
QTRY_COMPARE(spyModified.count(), spyCount);
135
QTRY_COMPARE(spyModified2.count(), spyCount2);
137
QTRY_COMPARE(spyModified.count(), spyCount);
138
QTRY_COMPARE(spyModified2.count(), spyCount2);
141
void TestModified::testGroupSets()
144
QScopedPointer<Database> db(new Database());
145
auto* root = db->rootGroup();
147
auto* group = new Group();
148
group->setParent(root);
150
QSignalSpy spyModified(db.data(), SIGNAL(modified()));
152
root->setUuid(QUuid::createUuid());
154
QTRY_COMPARE(spyModified.count(), spyCount);
155
root->setUuid(root->uuid());
156
QTRY_COMPARE(spyModified.count(), spyCount);
158
root->setName("test");
160
QTRY_COMPARE(spyModified.count(), spyCount);
161
root->setName(root->name());
162
QTRY_COMPARE(spyModified.count(), spyCount);
164
root->setNotes("test");
166
QTRY_COMPARE(spyModified.count(), spyCount);
167
root->setNotes(root->notes());
168
QTRY_COMPARE(spyModified.count(), spyCount);
172
QTRY_COMPARE(spyModified.count(), spyCount);
173
root->setIcon(root->iconNumber());
174
QTRY_COMPARE(spyModified.count(), spyCount);
176
root->setIcon(QUuid::createUuid());
178
QTRY_COMPARE(spyModified.count(), spyCount);
179
root->setIcon(root->iconUuid());
180
QTRY_COMPARE(spyModified.count(), spyCount);
182
group->setUuid(QUuid::createUuid());
184
QTRY_COMPARE(spyModified.count(), spyCount);
185
group->setUuid(group->uuid());
186
QTRY_COMPARE(spyModified.count(), spyCount);
188
group->setName("test");
190
QTRY_COMPARE(spyModified.count(), spyCount);
191
group->setName(group->name());
192
QTRY_COMPARE(spyModified.count(), spyCount);
194
group->setNotes("test");
196
QTRY_COMPARE(spyModified.count(), spyCount);
197
group->setNotes(group->notes());
198
QTRY_COMPARE(spyModified.count(), spyCount);
202
QTRY_COMPARE(spyModified.count(), spyCount);
203
group->setIcon(group->iconNumber());
204
QTRY_COMPARE(spyModified.count(), spyCount);
206
group->setIcon(QUuid::createUuid());
208
QTRY_COMPARE(spyModified.count(), spyCount);
209
group->setIcon(group->iconUuid());
210
QTRY_COMPARE(spyModified.count(), spyCount);
213
void TestModified::testEntrySets()
216
QScopedPointer<Database> db(new Database());
217
auto* root = db->rootGroup();
219
auto* group = new Group();
220
group->setParent(root);
221
auto* entry = new Entry();
222
entry->setGroup(group);
224
QSignalSpy spyModified(db.data(), SIGNAL(modified()));
226
entry->setUuid(QUuid::createUuid());
228
QTRY_COMPARE(spyModified.count(), spyCount);
229
entry->setUuid(entry->uuid());
230
QTRY_COMPARE(spyModified.count(), spyCount);
232
entry->setTitle("test");
234
QTRY_COMPARE(spyModified.count(), spyCount);
235
entry->setTitle(entry->title());
236
QTRY_COMPARE(spyModified.count(), spyCount);
238
entry->setUrl("test");
240
QTRY_COMPARE(spyModified.count(), spyCount);
241
entry->setUrl(entry->url());
242
QTRY_COMPARE(spyModified.count(), spyCount);
244
entry->setUsername("test");
246
QTRY_COMPARE(spyModified.count(), spyCount);
247
entry->setUsername(entry->username());
248
QTRY_COMPARE(spyModified.count(), spyCount);
250
entry->setPassword("test");
252
QTRY_COMPARE(spyModified.count(), spyCount);
253
entry->setPassword(entry->password());
254
QTRY_COMPARE(spyModified.count(), spyCount);
256
entry->setNotes("test");
258
QTRY_COMPARE(spyModified.count(), spyCount);
259
entry->setNotes(entry->notes());
260
QTRY_COMPARE(spyModified.count(), spyCount);
264
QTRY_COMPARE(spyModified.count(), spyCount);
265
entry->setIcon(entry->iconNumber());
266
QTRY_COMPARE(spyModified.count(), spyCount);
268
entry->setIcon(QUuid::createUuid());
270
QTRY_COMPARE(spyModified.count(), spyCount);
271
entry->setIcon(entry->iconUuid());
272
QTRY_COMPARE(spyModified.count(), spyCount);
274
entry->setTags("test");
276
QTRY_COMPARE(spyModified.count(), spyCount);
277
entry->setTags(entry->tags());
278
QTRY_COMPARE(spyModified.count(), spyCount);
280
entry->setExpires(true);
282
QTRY_COMPARE(spyModified.count(), spyCount);
283
entry->setExpires(entry->timeInfo().expires());
284
QTRY_COMPARE(spyModified.count(), spyCount);
286
entry->setExpiryTime(Clock::currentDateTimeUtc().addYears(1));
288
QTRY_COMPARE(spyModified.count(), spyCount);
289
entry->setExpiryTime(entry->timeInfo().expiryTime());
290
QTRY_COMPARE(spyModified.count(), spyCount);
292
entry->setAutoTypeEnabled(false);
294
QTRY_COMPARE(spyModified.count(), spyCount);
295
entry->setAutoTypeEnabled(entry->autoTypeEnabled());
296
QTRY_COMPARE(spyModified.count(), spyCount);
298
entry->setAutoTypeObfuscation(1);
300
QTRY_COMPARE(spyModified.count(), spyCount);
301
entry->setAutoTypeObfuscation(entry->autoTypeObfuscation());
302
QTRY_COMPARE(spyModified.count(), spyCount);
304
entry->setDefaultAutoTypeSequence("test");
306
QTRY_COMPARE(spyModified.count(), spyCount);
307
entry->setDefaultAutoTypeSequence(entry->defaultAutoTypeSequence());
308
QTRY_COMPARE(spyModified.count(), spyCount);
310
entry->setForegroundColor(QString("#FF0000"));
312
QTRY_COMPARE(spyModified.count(), spyCount);
313
entry->setForegroundColor(entry->foregroundColor());
314
QTRY_COMPARE(spyModified.count(), spyCount);
316
entry->setBackgroundColor(QString("#FF0000"));
318
QTRY_COMPARE(spyModified.count(), spyCount);
319
entry->setBackgroundColor(entry->backgroundColor());
320
QTRY_COMPARE(spyModified.count(), spyCount);
322
entry->setOverrideUrl("test");
324
QTRY_COMPARE(spyModified.count(), spyCount);
325
entry->setOverrideUrl(entry->overrideUrl());
326
QTRY_COMPARE(spyModified.count(), spyCount);
328
entry->attributes()->set("test key", "test value", false);
330
QTRY_COMPARE(spyModified.count(), spyCount);
331
entry->attributes()->set("test key", entry->attributes()->value("test key"), false);
332
QTRY_COMPARE(spyModified.count(), spyCount);
333
entry->attributes()->set("test key", entry->attributes()->value("test key"), true);
335
QTRY_COMPARE(spyModified.count(), spyCount);
336
entry->attributes()->set("test key", "new test value", true);
338
QTRY_COMPARE(spyModified.count(), spyCount);
340
entry->attributes()->set("test key2", "test value2", true);
342
QTRY_COMPARE(spyModified.count(), spyCount);
343
entry->attributes()->set("test key2", entry->attributes()->value("test key2"), true);
344
QTRY_COMPARE(spyModified.count(), spyCount);
347
void TestModified::testHistoryItems()
349
QScopedPointer<Entry> entry(new Entry());
350
QDateTime created = entry->timeInfo().creationTime();
351
entry->setUuid(QUuid::createUuid());
352
entry->setTitle("a");
354
QScopedPointer<EntryAttributes> attributes(new EntryAttributes());
355
attributes->copyCustomKeysFrom(entry->attributes());
357
int historyItemsSize = 0;
359
entry->beginUpdate();
360
entry->setTitle("a");
362
entry->setOverrideUrl("");
364
QCOMPARE(entry->historyItems().size(), historyItemsSize);
366
QDateTime modified = entry->timeInfo().lastModificationTime();
367
m_clock->advanceSecond(10);
368
entry->beginUpdate();
369
entry->setTitle("b");
371
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
372
auto* historyEntry = entry->historyItems().at(historyItemsSize - 1);
373
QCOMPARE(historyEntry->title(), QString("a"));
374
QCOMPARE(historyEntry->uuid(), entry->uuid());
375
QCOMPARE(historyEntry->tags(), entry->tags());
376
QCOMPARE(historyEntry->overrideUrl(), entry->overrideUrl());
377
QCOMPARE(historyEntry->timeInfo().creationTime(), created);
378
QCOMPARE(historyEntry->timeInfo().lastModificationTime(), modified);
379
QCOMPARE(historyEntry->historyItems().size(), 0);
381
entry->beginUpdate();
384
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
385
QCOMPARE(entry->historyItems().at(historyItemsSize - 1)->tags(), QString("a"));
387
entry->beginUpdate();
388
entry->attachments()->set("test", QByteArray("value"));
390
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
391
QCOMPARE(entry->historyItems().at(historyItemsSize - 1)->attachments()->keys().size(), 0);
393
attributes->set("k", "myvalue");
394
entry->beginUpdate();
395
entry->attributes()->copyCustomKeysFrom(attributes.data());
397
QCOMPARE(entry->historyItems().size(), ++historyItemsSize);
398
QVERIFY(!entry->historyItems().at(historyItemsSize - 1)->attributes()->keys().contains("k"));
400
QScopedPointer<Database> db(new Database());
401
auto* root = db->rootGroup();
402
db->metadata()->setHistoryMaxItems(3);
403
db->metadata()->setHistoryMaxSize(-1);
405
auto* entry2 = new Entry();
406
entry2->setGroup(root);
407
entry2->beginUpdate();
408
entry2->setTitle("1");
411
entry2->beginUpdate();
412
entry2->setTitle("2");
414
entry2->beginUpdate();
415
entry2->setTitle("3");
417
QCOMPARE(entry2->historyItems().size(), 3);
419
entry2->beginUpdate();
420
entry2->setTitle("4");
422
QCOMPARE(entry2->historyItems().size(), 3);
424
db->metadata()->setHistoryMaxItems(1);
426
entry2->beginUpdate();
427
entry2->setTitle("5");
429
QCOMPARE(entry2->historyItems().size(), 1);
431
auto* historyEntry2 = entry2->historyItems().at(0);
432
QCOMPARE(historyEntry2->title(), QString("4"));
434
db->metadata()->setHistoryMaxItems(-1);
436
for (int i = 0; i < 20; i++) {
437
entry2->beginUpdate();
438
entry2->setTitle("6");
440
entry2->beginUpdate();
441
entry2->setTitle("6b");
444
QCOMPARE(entry2->historyItems().size(), 41);
446
db->metadata()->setHistoryMaxItems(0);
448
entry2->beginUpdate();
449
entry2->setTitle("7");
451
QCOMPARE(entry2->historyItems().size(), 0);
453
const int historyMaxSize = 19000;
455
db->metadata()->setHistoryMaxItems(-1);
456
db->metadata()->setHistoryMaxSize(historyMaxSize);
458
const QString key("test");
459
entry2->beginUpdate();
460
entry2->attachments()->set(key, QByteArray(18000, 'X'));
462
QCOMPARE(entry2->attachments()->attachmentsSize(), 18000 + key.size());
463
QCOMPARE(entry2->historyItems().size(), 1);
465
historyEntry2 = entry2->historyItems().at(0);
466
QCOMPARE(historyEntry2->title(), QString("7"));
468
entry2->beginUpdate();
469
entry2->setTitle("8");
471
QCOMPARE(entry2->historyItems().size(), 2);
473
entry2->beginUpdate();
474
entry2->attachments()->remove(key);
476
QCOMPARE(entry2->attachments()->attachmentsSize(), 0);
477
QCOMPARE(entry2->historyItems().size(), 1);
479
entry2->beginUpdate();
480
entry2->attachments()->set("test2", QByteArray(6000, 'a'));
482
QCOMPARE(entry2->attachments()->attachmentsSize(), 6000 + key.size() + 1);
483
QCOMPARE(entry2->historyItems().size(), 2);
485
entry2->beginUpdate();
486
entry2->attachments()->set("test3", QByteArray(6000, 'b'));
488
QCOMPARE(entry2->attachments()->attachmentsSize(), 12000 + (key.size() + 1) * 2);
489
QCOMPARE(entry2->historyItems().size(), 2);
491
entry2->beginUpdate();
492
entry2->attachments()->set("test4", QByteArray(6000, 'c'));
494
QCOMPARE(entry2->attachments()->attachmentsSize(), 18000 + (key.size() + 1) * 3);
495
QCOMPARE(entry2->historyItems().size(), 3);
497
entry2->beginUpdate();
498
entry2->attachments()->set("test5", QByteArray(6000, 'd'));
500
QCOMPARE(entry2->attachments()->attachmentsSize(), 24000 + (key.size() + 1) * 4);
501
QCOMPARE(entry2->historyItems().size(), 1);
504
void TestModified::testHistoryMaxSize()
506
QScopedPointer<Database> db(new Database());
507
const QString key("test");
509
auto entry1 = new Entry();
510
entry1->setGroup(db->rootGroup());
511
QCOMPARE(entry1->historyItems().size(), 0);
513
const int reservedSize1 = entry1->attributes()->attributesSize();
514
db->metadata()->setHistoryMaxItems(-1);
515
db->metadata()->setHistoryMaxSize(18000 + key.size() * 3 + reservedSize1 * 4);
517
entry1->beginUpdate();
518
entry1->attachments()->set(key, QByteArray(6000, 'a'));
520
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
521
QCOMPARE(entry1->historyItems().size(), 1);
523
entry1->beginUpdate();
524
entry1->attachments()->set(key, QByteArray(6000, 'b'));
526
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
527
QCOMPARE(entry1->historyItems().size(), 2);
529
entry1->beginUpdate();
530
entry1->attachments()->set(key, QByteArray(6000, 'c'));
532
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
533
QCOMPARE(entry1->historyItems().size(), 3);
535
entry1->beginUpdate();
536
entry1->attachments()->set(key, QByteArray(6000, 'd'));
538
QCOMPARE(entry1->attachments()->attachmentsSize(), 6000 + key.size());
539
QCOMPARE(entry1->historyItems().size(), 4);
541
auto entry2 = new Entry();
542
entry2->setGroup(db->rootGroup());
543
QCOMPARE(entry2->historyItems().size(), 0);
545
const int historyMaxSize = 17000;
546
const int reservedSize2 = entry2->attributes()->attributesSize();
547
db->metadata()->setHistoryMaxSize(historyMaxSize);
549
entry2->beginUpdate();
550
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a'));
552
QCOMPARE(entry2->attachments()->attachmentsSize(), historyMaxSize - reservedSize2 + 1);
553
QCOMPARE(entry2->historyItems().size(), 1);
556
entry2->beginUpdate();
557
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'b'));
559
QCOMPARE(entry2->historyItems().size(), 0);
561
entry2->beginUpdate();
562
entry2->attachments()->remove(key);
564
QCOMPARE(entry2->attachments()->attachmentsSize(), 0);
565
QCOMPARE(entry2->historyItems().size(), 0);
567
entry2->beginUpdate();
568
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a'));
570
QCOMPARE(entry2->attachments()->attachmentsSize(), historyMaxSize - reservedSize2 + 1);
571
QCOMPARE(entry2->historyItems().size(), 1);
574
entry2->beginUpdate();
575
entry2->attachments()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'b'));
577
QCOMPARE(entry2->historyItems().size(), 0);
579
entry2->beginUpdate();
580
entry2->attachments()->remove(key);
582
QCOMPARE(entry2->attachments()->attachmentsSize(), 0);
583
QCOMPARE(entry2->historyItems().size(), 0);
585
entry2->beginUpdate();
586
entry2->setTags(QByteArray(historyMaxSize - reservedSize2 + 1, 'a'));
588
QCOMPARE(entry2->tags().size(), historyMaxSize - reservedSize2 + 1);
589
QCOMPARE(entry2->historyItems().size(), 1);
592
entry2->beginUpdate();
593
entry2->setTags(QByteArray(historyMaxSize - reservedSize2 + 1, 'b'));
595
QCOMPARE(entry2->historyItems().size(), 0);
597
entry2->beginUpdate();
600
QCOMPARE(entry2->historyItems().size(), 0);
602
entry2->beginUpdate();
603
entry2->attributes()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a'));
605
QCOMPARE(entry2->attributes()->attributesSize(), historyMaxSize + 1);
606
QCOMPARE(entry2->historyItems().size(), 1);
609
entry2->beginUpdate();
610
entry2->attributes()->set(key, QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'b'));
612
QCOMPARE(entry2->attributes()->attributesSize(), historyMaxSize + 1);
613
QCOMPARE(entry2->historyItems().size(), 0);
615
entry2->beginUpdate();
616
entry2->attributes()->remove(key);
618
QCOMPARE(entry2->attributes()->attributesSize(), reservedSize2);
619
QCOMPARE(entry2->historyItems().size(), 0);
621
entry2->beginUpdate();
622
AutoTypeAssociations::Association association;
623
association.window = key;
624
association.sequence = QByteArray(historyMaxSize - key.size() - reservedSize2 + 1, 'a');
625
entry2->autoTypeAssociations()->add(association);
627
QCOMPARE(entry2->autoTypeAssociations()->associationsSize(), historyMaxSize - reservedSize2 + 1);
628
QCOMPARE(entry2->historyItems().size(), 1);
630
entry2->beginUpdate();
631
entry2->autoTypeAssociations()->remove(0);
633
QCOMPARE(entry2->autoTypeAssociations()->associationsSize(), 0);
634
QCOMPARE(entry2->historyItems().size(), 0);
637
void TestModified::testCustomData()
640
QScopedPointer<Database> db(new Database());
641
auto* root = db->rootGroup();
643
auto* group = new Group();
644
group->setParent(root);
645
auto* entry = new Entry();
646
entry->setGroup(group);
648
QSignalSpy spyModified(db.data(), SIGNAL(modified()));
650
db->metadata()->customData()->set("Key", "Value");
652
QTRY_COMPARE(spyModified.count(), spyCount);
653
db->metadata()->customData()->set("Key", "Value");
654
QTRY_COMPARE(spyModified.count(), spyCount);
656
entry->customData()->set("Key", "Value");
658
QTRY_COMPARE(spyModified.count(), spyCount);
659
entry->customData()->set("Key", "Value");
660
QTRY_COMPARE(spyModified.count(), spyCount);
662
group->customData()->set("Key", "Value");
664
QTRY_COMPARE(spyModified.count(), spyCount);
665
group->customData()->set("Key", "Value");
666
QTRY_COMPARE(spyModified.count(), spyCount);
669
void TestModified::testBlockModifiedSignal()
671
QScopedPointer<Database> db(new Database());
672
auto entry = db->rootGroup()->addEntryWithPath("/abc");
674
QSignalSpy spyDbModified(db.data(), SIGNAL(modified()));
675
QSignalSpy spyMetadataModified(db->metadata(), SIGNAL(modified()));
676
QSignalSpy spyCustomDataModified(db->metadata()->customData(), SIGNAL(modified()));
677
QSignalSpy spyGroupModified(db->rootGroup(), SIGNAL(modified()));
678
QSignalSpy spyGroupCustomDataModified(db->rootGroup()->customData(), SIGNAL(modified()));
679
QSignalSpy spyEntryModified(entry, SIGNAL(modified()));
680
QSignalSpy spyEntryCustomDataModified(entry->customData(), SIGNAL(modified()));
681
QSignalSpy spyEntryAttributesModified(entry->attributes(), SIGNAL(modified()));
682
QSignalSpy spyEntryAttachmentModified(entry->attachments(), SIGNAL(modified()));
683
QSignalSpy spyEntryAutoTypeAssociationsModified(entry->autoTypeAssociations(), SIGNAL(modified()));
685
QVERIFY(spyDbModified.isValid());
686
QVERIFY(spyMetadataModified.isValid());
687
QVERIFY(spyCustomDataModified.isValid());
688
QVERIFY(spyGroupModified.isValid());
689
QVERIFY(spyGroupCustomDataModified.isValid());
690
QVERIFY(spyEntryModified.isValid());
691
QVERIFY(spyEntryCustomDataModified.isValid());
692
QVERIFY(spyEntryAttributesModified.isValid());
693
QVERIFY(spyEntryAttachmentModified.isValid());
694
QVERIFY(spyEntryAutoTypeAssociationsModified.isValid());
696
db->setEmitModified(false);
698
auto* group1 = new Group();
699
group1->setParent(db->rootGroup());
700
db->metadata()->setName("Modified Database");
701
db->metadata()->customData()->set("Key", "Value");
703
group1->customData()->set("abc", "dd");
704
entry->setTitle("Another Title");
705
entry->customData()->set("entryabc", "dd");
706
entry->attributes()->set("aaa", "dd");
707
entry->attachments()->set("aaa", {});
708
entry->autoTypeAssociations()->add({"", ""});
712
QCOMPARE(spyDbModified.count(), 0);
713
QCOMPARE(spyMetadataModified.count(), 0);
714
QCOMPARE(spyCustomDataModified.count(), 0);
715
QCOMPARE(spyGroupModified.count(), 0);
716
QCOMPARE(spyGroupCustomDataModified.count(), 0);
717
QCOMPARE(spyEntryModified.count(), 0);
718
QCOMPARE(spyEntryCustomDataModified.count(), 0);
719
QCOMPARE(spyEntryAttributesModified.count(), 0);
720
QCOMPARE(spyEntryAttachmentModified.count(), 0);
721
QCOMPARE(spyEntryAutoTypeAssociationsModified.count(), 0);