Properly reset fakefolder test state post-placeholder file delete in testsyncvirtualfiles

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-06-26 15:07:50 +08:00 committed by Matthieu Gallien
parent 0757e94b50
commit 2915e2517e

View file

@ -182,7 +182,20 @@ private slots:
QVERIFY(fakeFolder.syncOnce());
QVERIFY(!fakeFolder.currentLocalState().find("A/a1"));
QVERIFY(!fakeFolder.currentLocalState().find("A/a1" DVSUFFIX));
QVERIFY(!fakeFolder.currentRemoteState().find("A/a1"));
QVERIFY(!fakeFolder.remoteModifier().find("A/a1"));
cleanup();
// Restore the state prior to next test
// Essentially repeating creation of virtual file
fakeFolder.remoteModifier().insert("A/a1", 64);
fakeFolder.remoteModifier().setModTime("A/a1", someDate);
QVERIFY(fakeFolder.syncOnce());
QVERIFY(!fakeFolder.currentLocalState().find("A/a1"));
QVERIFY(fakeFolder.currentLocalState().find("A/a1" DVSUFFIX));
QCOMPARE(QFileInfo(fakeFolder.localPath() + "A/a1" DVSUFFIX).lastModified(), someDate);
QVERIFY(fakeFolder.currentRemoteState().find("A/a1"));
QVERIFY(itemInstruction(completeSpy, "A/a1" DVSUFFIX, CSYNC_INSTRUCTION_NEW));
QCOMPARE(dbRecord(fakeFolder, "A/a1" DVSUFFIX)._type, ItemTypeVirtualFile);
cleanup();
// Remote rename is propagated