summaryrefslogtreecommitdiff
path: root/src/settings/test/test_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/test/test_settings.cpp')
-rw-r--r--src/settings/test/test_settings.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/settings/test/test_settings.cpp b/src/settings/test/test_settings.cpp
index babbcdb6..24bbf349 100644
--- a/src/settings/test/test_settings.cpp
+++ b/src/settings/test/test_settings.cpp
@@ -76,14 +76,16 @@ TEST(settings, Settings)
TEST(settings, SettingsDialog)
{
+ constexpr unsigned n_settings = 36; // there are 36 settings in total
MockSettings mockSettings;
// There are 4 groups in total, but General should not be calling beginGroup/endGroup
// beginGroup/endGroup are called twice: during the ctor and when accepted
EXPECT_CALL(mockSettings, beginGroup).Times(3 * 4);
EXPECT_CALL(mockSettings, endGroup).Times(3 * 4);
- // There are 35 settings in total, one of which is hidden and won't be set by the dialog
- EXPECT_CALL(mockSettings, value).Times(35 * 2).WillRepeatedly(ReturnArg<1>());
- EXPECT_CALL(mockSettings, setValue(_, _)).Times(33 + 34);
+ EXPECT_CALL(mockSettings, value).Times(n_settings * 2).WillRepeatedly(ReturnArg<1>());
+ // 1 setting is hidden and won't be set by the dialog
+ // save and reset will both call setValue on all non-hidden settings
+ EXPECT_CALL(mockSettings, setValue(_, _)).Times(n_settings * 2 - 3);
EXPECT_CALL(mockSettings, setValue(QStringEq("homepage"), QVariantEq("about:blank")));
// change setting