From 8e288a9060545989533505699c19d9997e6a8aff Mon Sep 17 00:00:00 2001 From: aqua Date: Thu, 1 Sep 2022 19:32:26 +0300 Subject: Add scripts/qrc_lint.py --- src/settings/test/test_settings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/settings/test/test_settings.cpp') 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 -- cgit v1.2.1