diff --git a/test/testsyncvirtualfiles.cpp b/test/testsyncvirtualfiles.cpp index b561eb2c94e8..c90a55e322f6 100644 --- a/test/testsyncvirtualfiles.cpp +++ b/test/testsyncvirtualfiles.cpp @@ -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