| 78 | } |
| 79 | |
| 80 | bool createFile(const QString& path) |
| 81 | { |
| 82 | QFile f(path); |
| 83 | if (!f.open(QIODevice::WriteOnly)) { |
| 84 | qWarning() << f.errorString() << path; |
| 85 | return false; |
| 86 | } |
| 87 | |
| 88 | auto* randomGenerator = QRandomGenerator::global(); |
| 89 | for (int i = 0; i < 4; ++i) { |
| 90 | f.write(QByteArray::number(randomGenerator->generate())); |
| 91 | } |
| 92 | |
| 93 | if (!f.flush()) { |
| 94 | qWarning() << f.errorString() << path; |
| 95 | return false; |
| 96 | } |
| 97 | |
| 98 | f.close(); |
| 99 | return true; |
| 100 | } |
| 101 | |
| 102 | bool writeRandomStructure(QString path, int files) |
| 103 | { |
no test coverage detected