From ff40d2a6dffdf234ade8bc4a5faa7624e58d5379 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 24 Sep 2026 17:50:47 +0200 Subject: fix: drop orphaned overrides when a series stops, plus review minors --- tests/test_config.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/test_config.cpp') 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" -- cgit v1.2.3