Debian Codegraph @

tests/albumview/mock_mount.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
3 *
4 * Author: WangZhengYang <[email protected]>
5 *
6 * Maintainer: ZhangYong <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #pragma once
23
24 #include <QString>
25 #include <QSharedData>
26
27 #include <dgiofile.h>
28
29 class Stub;
30
31 class Mock_Mount
32 {
33 public:
34 Mock_Mount(const QString &mountPoint);
35 ~Mock_Mount();
36
37 //初始化挂载测试
38 void initMountMock();
39
40 //为卸载设备准备
41 void setToUmountDevice();
42
43 //DGioMount需要的桩函数
44 QString stub_DGioMount_name();
45 QExplicitlySharedDataPointer<DGioFile> stub_DGioMount_getRootFile();
46 bool stub_DGioMount_canEject() const;
47 QExplicitlySharedDataPointer<DGioFile> stub_DGioMount_getDefaultLocationFile();
48
49 //DGioFile需要的桩函数
50 QString stub_DGioFile_uri();
51 QString stub_DGioFile_path();
52
53 //DGioVolumeManager需要的桩函数
54 const QList<QExplicitlySharedDataPointer<DGioMount> > stub_DGioVolumeManager_getMounts(); //这个是静态函数,打桩有点难度
55
56 private:
57 //打桩工具
58 Stub *stub;
59
60 //文件保存位置
61 static QString mountPoint;
62 };