From: Camila Ayres Date: Wed, 11 Dec 2024 12:14:49 +0000 (+0100) Subject: Update tests for folder check to match fix. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~189^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=638f3a86479553543ac9ed9566d06eb1c430acfa;p=nextcloud-desktop.git Update tests for folder check to match fix. Signed-off-by: Camila Ayres --- diff --git a/test/testfolderman.cpp b/test/testfolderman.cpp index 7a15c17e0..f40c3c7e4 100644 --- a/test/testfolderman.cpp +++ b/test/testfolderman.cpp @@ -288,7 +288,6 @@ private slots: QVERIFY(!folder->isSyncRunning()); } - // those should be allowed // QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl &serverUrl, bool forNewDirectory).second @@ -311,15 +310,15 @@ private slots: QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/sub/ownCloud1", url2).second.isNull()); QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/ownCloud2/", url2).second.isNull()); - // Now it will work because the account is different + // The following both fail because they are already sync folders even if for another account QUrl url3("http://anotherexample.org"); url3.setUserName("dummy"); - QCOMPARE(folderman->checkPathValidityForNewFolder(dirPath + "/sub/ownCloud1", url3).second, QString()); - QCOMPARE(folderman->checkPathValidityForNewFolder(dirPath + "/ownCloud2/", url3).second, QString()); + QCOMPARE(folderman->checkPathValidityForNewFolder(dirPath + "/sub/ownCloud1", url3).second, QString("The folder %1 is used in a folder sync connection!").arg(QDir::toNativeSeparators(dirPath + "/sub/ownCloud1"))); + QCOMPARE(folderman->checkPathValidityForNewFolder(dirPath + "/ownCloud2", url3).second, QString("The folder %1 is used in a folder sync connection!").arg(QDir::toNativeSeparators(dirPath + "/ownCloud2"))); QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath).second.isNull()); QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/sub/ownCloud1/folder").second.isNull()); - QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/sub/ownCloud1/folder/f").second.isNull()); + QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/sub/ownCloud1/f").second.isNull()); #ifndef Q_OS_WIN // no links on windows, no permissions // make a bunch of links @@ -338,7 +337,7 @@ private slots: // link 3 points to an existing sync folder. To make it fail, the account must be the same QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/link3", url2).second.isNull()); // while with a different account, this is fine - QCOMPARE(folderman->checkPathValidityForNewFolder(dirPath + "/link3", url3).second, QString()); + QCOMPARE(folderman->checkPathValidityForNewFolder(dirPath + "/link3", url3).second, QString("The folder %1 is used in a folder sync connection!").arg(dirPath + "/link3")); QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/link4").second.isNull()); QVERIFY(!folderman->checkPathValidityForNewFolder(dirPath + "/link3/folder").second.isNull());