diff --git a/test/testsyncvirtualfiles.cpp b/test/testsyncvirtualfiles.cpp index 29f03c29a976..d4f327572605 100644 --- a/test/testsyncvirtualfiles.cpp +++ b/test/testsyncvirtualfiles.cpp @@ -174,7 +174,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