mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-23 12:55:44 +03:00
fix failing automated test that erases invalid iterator
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
ced85ac287
commit
274d866c19
2 changed files with 8 additions and 4 deletions
|
@ -159,8 +159,13 @@ void FileInfo::remove(const QString &relativePath)
|
|||
const PathComponents pathComponents { relativePath };
|
||||
FileInfo *parent = findInvalidatingEtags(pathComponents.parentDirComponents());
|
||||
Q_ASSERT(parent);
|
||||
parent->children.erase(std::find_if(parent->children.begin(), parent->children.end(),
|
||||
[&pathComponents](const FileInfo &fi) { return fi.name == pathComponents.fileName(); }));
|
||||
auto childrenIt = std::find_if(parent->children.begin(), parent->children.end(),
|
||||
[&pathComponents](const FileInfo &fi) {
|
||||
return fi.name == pathComponents.fileName();
|
||||
});
|
||||
if (childrenIt != parent->children.end()) {
|
||||
parent->children.erase(childrenIt);
|
||||
}
|
||||
}
|
||||
|
||||
void FileInfo::insert(const QString &relativePath, qint64 size, char contentChar)
|
||||
|
|
|
@ -1700,8 +1700,7 @@ private slots:
|
|||
conflicts = findCaseClashConflicts(fakeFolder.currentLocalState());
|
||||
QCOMPARE(conflicts.size(), 0);
|
||||
|
||||
// remove both files from the server(lower and UPPER case)
|
||||
fakeFolder.remoteModifier().remove(testLowerCaseFile);
|
||||
// remove the other file
|
||||
fakeFolder.remoteModifier().remove(testUpperCaseFile);
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue