From bb00ba059808fd8b136ffd66362ea5d3ca19f91e Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Wed, 11 Dec 2024 13:14:49 +0100 Subject: [PATCH] Update tests for folder check to match fix. Signed-off-by: Camila Ayres --- test/testfolderman.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/testfolderman.cpp b/test/testfolderman.cpp index 7a15c17e03e92..f40c3c7e4e1c6 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());