| 41 | }; |
| 42 | |
| 43 | void TestServer::writeIniFile(const QString &fileName, const QMap<QString, QVariantMap> &data) |
| 44 | { |
| 45 | QSettings ini{fileName, QSettings::IniFormat}; |
| 46 | QCOMPARE(ini.status(), QSettings::NoError); |
| 47 | QVERIFY(ini.isWritable()); |
| 48 | |
| 49 | for (const auto &[key, map] : data.asKeyValueRange()) { |
| 50 | ini.beginGroup(key); |
| 51 | for (const auto &[mapKey, mapValue] : map.asKeyValueRange()) { |
| 52 | ini.setValue(mapKey, mapValue); |
| 53 | } |
| 54 | ini.endGroup(); |
| 55 | } |
| 56 | |
| 57 | ini.sync(); |
| 58 | QCOMPARE(ini.status(), QSettings::NoError); |
| 59 | } |
| 60 | |
| 61 | void TestServer::writeJsonFile(const QString &fileName, const QJsonObject &data) |
| 62 | { |