Commit eb9d694f authored by Fabian Vogt's avatar Fabian Vogt

Merge branch 'noreplacetest' into 'master'

Add test for RENAME_NOREPLACE

See merge request kde/kio-fuse!15
parents 13bb302b bdd23ebb
......@@ -457,6 +457,12 @@ void FileOpsTest::testRenameOps()
QVERIFY(overwrittenFile.open(QIODevice::ReadWrite));
QCOMPARE(overwrittenFile.write(QStringLiteral("data").toUtf8()), 4);
QVERIFY(overwrittenFile.flush());
#ifdef RENAME_NOREPLACE
QCOMPARE(renameat2(AT_FDCWD, mirrorDir.filePath(QStringLiteral("dirb/fileb")).toUtf8().data(),
AT_FDCWD, mirrorDir.filePath(QStringLiteral("dirb/filec")).toUtf8().data(),
RENAME_NOREPLACE), -1);
QCOMPARE(errno, EEXIST);
#endif
QCOMPARE(rename(mirrorDir.filePath(QStringLiteral("dirb/fileb")).toUtf8().data(),
mirrorDir.filePath(QStringLiteral("dirb/filec")).toUtf8().data()), 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment