From baf9c8b631315c8ae1e8a916e087b1a0fe2672ab Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 6 Mar 2023 18:16:50 +0100 Subject: [PATCH] add test for windows CfApi Signed-off-by: Matthieu Gallien --- test/testsynccfapi.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/testsynccfapi.cpp b/test/testsynccfapi.cpp index 4b06b6e15cc72..95dd076ffc38f 100644 --- a/test/testsynccfapi.cpp +++ b/test/testsynccfapi.cpp @@ -1218,6 +1218,32 @@ private slots: CFVERIFY_VIRTUAL(fakeFolder, "online/sub/file1"); } } + + void testDataFingerPrint() + { + FakeFolder fakeFolder{ FileInfo{} }; + setupVfs(fakeFolder); + + fakeFolder.remoteModifier().mkdir("a"); + fakeFolder.remoteModifier().mkdir("a/b"); + fakeFolder.remoteModifier().mkdir("a/b/d"); + fakeFolder.remoteModifier().insert("a/b/otherFile.txt"); + + //Server support finger print, but none is set. + fakeFolder.remoteModifier().extraDavProperties = ""; + + fakeFolder.syncEngine().setLocalDiscoveryOptions(OCC::LocalDiscoveryStyle::DatabaseAndFilesystem); + QVERIFY(fakeFolder.syncOnce()); + + fakeFolder.remoteModifier().remove("a/b/otherFile.txt"); + fakeFolder.remoteModifier().remove("a/b/d"); + fakeFolder.remoteModifier().extraDavProperties = "initial_finger_print"; + + fakeFolder.syncEngine().setLocalDiscoveryOptions(OCC::LocalDiscoveryStyle::DatabaseAndFilesystem); + QVERIFY(fakeFolder.syncOnce()); + + QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState()); + } }; QTEST_GUILESS_MAIN(TestSyncCfApi)