Skip to content

Commit

Permalink
#3027 fix: tests for macOS
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Sep 25, 2024
1 parent d9cfe76 commit aeb00b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit_tests/testcases/app/test_settingsservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,23 @@ void TestSettingsService::testClear() {
settings.setValue(key, value);
QVERIFY(settings.contains(key));
QVERIFY(settings.value(key).toString() == value);
#ifndef Q_OS_MACOS
// Don't test allKeys() on macOS, because it always puts extra keys in the settings
QVERIFY(settings.allKeys().count() == 1);
QVERIFY(QSettings().allKeys().count() == 1);
#endif

// Clear the settings and test if they were removed
settings.clear();
QVERIFY(!settings.contains(key));
QVERIFY(settings.value(key).toString() != value);
QVERIFY(!QSettings().contains(key));
QVERIFY(QSettings().value(key).toString() != value);
#ifndef Q_OS_MACOS
// Don't test allKeys() on macOS, because it always puts extra keys in the settings
QVERIFY(settings.allKeys().isEmpty());
QVERIFY(QSettings().allKeys().isEmpty());
#endif
}

void TestSettingsService::testGroupRemove() {
Expand Down

0 comments on commit aeb00b0

Please sign in to comment.