Overwrite the contents of the local file at @p localFileUrl with @p newContents. Check success with RETURN_IF_TEST_FAILED().
| 113 | /// Overwrite the contents of the local file at @p localFileUrl with @p newContents. |
| 114 | /// Check success with RETURN_IF_TEST_FAILED(). |
| 115 | void overwriteExistingFile(const QUrl& localFileUrl, const QString& newContents) |
| 116 | { |
| 117 | QFile file(localFileUrl.toLocalFile()); |
| 118 | QVERIFY(file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::ExistingOnly)); |
| 119 | QVERIFY(file.write(newContents.toUtf8()) != -1); |
| 120 | QVERIFY(file.flush()); |
| 121 | } |
| 122 | } // unnamed namespace |
| 123 | |
| 124 | /// Gather breakpoint marks in the document. |
no test coverage detected