Debian Codegraph @

tests/dde-calendar-client-test/src/test_configsettings.cpp

raw
1 // SPDX-FileCopyrightText: 2019 - 2026 UnionTech Software Technology Co., Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-or-later
4
5 #include "test_configsettings.h"
6
7 test_configsettings::test_configsettings()
8 {
9 }
10
11 test_configsettings::~test_configsettings()
12 {
13 }
14
15 void test_configsettings::SetUp()
16 {
17 conf = CConfigSettings::getInstance();
18 }
19
20 void test_configsettings::TearDown()
21 {
22
23 }
24
25 void stub_Handle()
26 {
27
28 }
29
30 void setValue_stub(void *obj, const QString &key, const QVariant &value)
31 {
32 Q_UNUSED(obj)
33 Q_UNUSED(key)
34 Q_UNUSED(value)}
35
36 //void CConfigSettings::sync()
37 TEST_F(test_configsettings, sync)
38 {
39 Stub stub;
40 stub.set(ADDR(CConfigSettings, sync), stub_Handle);
41 conf->sync();
42 }
43
44 TEST_F(test_configsettings, setOption)
45 {
46 Stub stub;
47 stub.set(ADDR(QSettings, setValue), setValue_stub);
48 conf->setOption("base.state", 0);
49 }