summaryrefslogtreecommitdiff
path: root/src/settings/test/test_settings.cpp
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-09-01 19:32:26 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-09-02 16:52:49 +0300
commit8e288a9060545989533505699c19d9997e6a8aff (patch)
tree8de51b9a8ed2f8f4e936edde7ce1d9861105cf5b /src/settings/test/test_settings.cpp
parentAdd tabler icon theme (diff)
downloadrekonq-master.tar.xz
Add scripts/qrc_lint.pyHEADmaster
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