diff --git a/test/testchunkingng.cpp b/test/testchunkingng.cpp index 82bdf7e3a62..043d135aa62 100644 --- a/test/testchunkingng.cpp +++ b/test/testchunkingng.cpp @@ -344,6 +344,7 @@ private slots: fakeFolder.setServerOverride([&](QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *) -> QNetworkReply * { if (request.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray() == "MOVE") { QTimer::singleShot(50ms, &parent, [&]() { fakeFolder.syncEngine().abort(); }); + // while the response is delayed, the move is performed in the custructor, so immideatly return new DelayedReply(responseDelay, fakeFolder.uploadState(), fakeFolder.remoteModifier(), op, request, &parent); } return nullptr; @@ -351,11 +352,17 @@ private slots: // Test 1: NEW file aborted fakeFolder.localModifier().insert(QStringLiteral("A/a0"), size); + QVERIFY(!fakeFolder.applyLocalModificationsAndSync()); + QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); + QVERIFY(fakeFolder.applyLocalModificationsAndSync()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); // Test 2: modified file upload aborted fakeFolder.localModifier().appendByte(QStringLiteral("A/a0")); + QVERIFY(!fakeFolder.applyLocalModificationsAndSync()); + QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); + QVERIFY(fakeFolder.applyLocalModificationsAndSync()); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); }