mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Tests: Fix permission propagation check
It was using the wrong path to the conflict file.
This commit is contained in:
parent
5089f55629
commit
60cb5d3b34
1 changed files with 3 additions and 8 deletions
|
@ -693,14 +693,9 @@ private slots:
|
||||||
QCOMPARE(QFileInfo(fakeFolder.localPath() + "A/a1").permissions(), perm);
|
QCOMPARE(QFileInfo(fakeFolder.localPath() + "A/a1").permissions(), perm);
|
||||||
QCOMPARE(QFileInfo(fakeFolder.localPath() + "A/a2").permissions(), perm);
|
QCOMPARE(QFileInfo(fakeFolder.localPath() + "A/a2").permissions(), perm);
|
||||||
|
|
||||||
// Currently the umask applies to conflict files
|
auto conflictName = fakeFolder.syncJournal().conflictRecord(fakeFolder.syncJournal().conflictRecordPaths().first()).path;
|
||||||
auto octmask = umask(0);
|
QVERIFY(conflictName.contains("A/a2"));
|
||||||
umask(octmask);
|
QCOMPARE(QFileInfo(fakeFolder.localPath() + conflictName).permissions(), perm);
|
||||||
// Qt uses 0x1, 0x2, 0x4 for "other"; 0x10, 0x20, 0x40 for "group" etc
|
|
||||||
auto qtmask = (octmask & 07) + 0x10 * ((octmask & 070) >> 3) + 0x100 * ((octmask & 0700) >> 6);
|
|
||||||
auto maskedPerm = QFileDevice::Permission(perm & (~qtmask));
|
|
||||||
auto conflictName = fakeFolder.syncJournal().conflictRecord("A/a2").path;
|
|
||||||
QCOMPARE(QFileInfo(fakeFolder.localPath() + conflictName).permissions(), maskedPerm);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue