diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-24 17:50:47 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-24 17:50:47 +0200 |
| commit | ff40d2a6dffdf234ade8bc4a5faa7624e58d5379 (patch) | |
| tree | cf7b2469957db7d6d602cd4532263750eecdb9c4 /tests/test_config.cpp | |
| parent | 7494ce76f1eefc2a9a2112d2f2ffec4709d90e08 (diff) | |
| download | qtmaildir-ff40d2a6dffdf234ade8bc4a5faa7624e58d5379.tar.gz qtmaildir-ff40d2a6dffdf234ade8bc4a5faa7624e58d5379.zip | |
fix: drop orphaned overrides when a series stops, plus review minors
Diffstat (limited to 'tests/test_config.cpp')
| -rw-r--r-- | tests/test_config.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_config.cpp b/tests/test_config.cpp index be343d1..b0597de 100644 --- a/tests/test_config.cpp +++ b/tests/test_config.cpp @@ -154,6 +154,7 @@ private slots: void calendarSyncCommandSurvivesACommaAndDefaults(); void calendarsDirThatDoesNotExistIsReported(); void calendarSyncDelayRejectsGarbage(); + void aNegativeCalendarSyncDelayIsOutOfRange(); }; static QString writeIni(const QTemporaryDir &dir, const QString &body) @@ -2963,5 +2964,19 @@ void TestConfig::calendarSyncDelayRejectsGarbage() QVERIFY(!config.problems().isEmpty()); } +void TestConfig::aNegativeCalendarSyncDelayIsOutOfRange() +{ + // "-5" parses, so "is not a number" would be a lie; the value is simply + // outside what the key accepts. It falls back to the default and says so. + QTemporaryDir dir; + Config config; + config.load(writeIni(dir, QStringLiteral("[general]\n" + "calendar_sync_delay_ms=-5\n"))); + QCOMPARE(config.calendarSyncDelayMs(), 2000); + const QString joined = config.problems().join(QLatin1Char('\n')); + QVERIFY2(joined.contains(QStringLiteral("out of range")), qPrintable(joined)); + QVERIFY2(!joined.contains(QStringLiteral("not a number")), qPrintable(joined)); +} + QTEST_MAIN(TestConfig) #include "test_config.moc" |
