• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef MOCK_STORAGE_MANAGER_STUB_H
16 #define MOCK_STORAGE_MANAGER_STUB_H
17 
18 #include "gmock/gmock.h"
19 
20 #include "ipc/storage_manager_stub.h"
21 
22 namespace OHOS {
23 namespace StorageManager {
24 class StorageManagerStubMock : public StorageManagerStub {
25 public:
26     MOCK_METHOD2(PrepareAddUser, int32_t(int32_t, uint32_t));
27     MOCK_METHOD2(RemoveUser, int32_t(int32_t, uint32_t));
28     MOCK_METHOD1(PrepareStartUser, int32_t(int32_t));
29     MOCK_METHOD1(StopUser, int32_t(int32_t));
30     MOCK_METHOD1(CompleteAddUser, int32_t(int32_t));
31 
32     MOCK_METHOD2(GetFreeSizeOfVolume, int32_t(std::string, int64_t &));
33     MOCK_METHOD2(GetTotalSizeOfVolume, int32_t(std::string, int64_t &));
34     MOCK_METHOD4(GetBundleStats, int32_t(std::string, BundleStats &, int32_t, uint32_t));
35     MOCK_METHOD1(GetSystemSize, int32_t(int64_t &));
36     MOCK_METHOD1(GetTotalSize, int32_t(int64_t &));
37     MOCK_METHOD1(GetFreeSize, int32_t(int64_t &));
38     MOCK_METHOD1(GetUserStorageStats, int32_t(StorageStats &));
39     MOCK_METHOD2(GetUserStorageStats, int32_t(int32_t, StorageStats &));
40     MOCK_METHOD3(GetUserStorageStatsByType, int32_t(int32_t, StorageStats &, std::string));
41     MOCK_METHOD2(GetCurrentBundleStats, int32_t(BundleStats &, uint32_t));
42 
43     MOCK_METHOD1(NotifyVolumeCreated, int32_t(VolumeCore));
44     MOCK_METHOD5(NotifyVolumeMounted, int32_t(std::string, int32_t, std::string, std::string, std::string));
45     MOCK_METHOD2(NotifyVolumeStateChanged, int32_t(std::string, VolumeState));
46     MOCK_METHOD1(Mount, int32_t(std::string));
47     MOCK_METHOD1(Unmount, int32_t(std::string));
48     MOCK_METHOD1(GetAllVolumes, int32_t(std::vector<VolumeExternal> &));
49     MOCK_METHOD1(NotifyDiskCreated, int32_t(Disk));
50     MOCK_METHOD1(NotifyDiskDestroyed, int32_t(std::string));
51     MOCK_METHOD2(Partition, int32_t(std::string, int32_t));
52     MOCK_METHOD1(GetAllDisks, int32_t(std::vector<Disk> &));
53     MOCK_METHOD2(GetVolumeByUuid, int32_t(std::string, VolumeExternal &));
54     MOCK_METHOD2(GetVolumeById, int32_t(std::string, VolumeExternal &));
55     MOCK_METHOD2(SetVolumeDescription, int32_t(std::string, std::string));
56     MOCK_METHOD2(Format, int32_t(std::string, std::string));
57     MOCK_METHOD2(GetDiskById, int32_t(std::string, Disk &));
58 
59     MOCK_METHOD2(GenerateUserKeys, int32_t(uint32_t, uint32_t));
60     MOCK_METHOD1(DeleteUserKeys, int32_t(uint32_t));
61     MOCK_METHOD5(UpdateUserAuth, int32_t(uint32_t, uint64_t, const std::vector<uint8_t> &,
62         const std::vector<uint8_t> &, const std::vector<uint8_t> &));
63     MOCK_METHOD3(ActiveUserKey, int32_t(uint32_t, const std::vector<uint8_t> &, const std::vector<uint8_t> &));
64     MOCK_METHOD1(InactiveUserKey, int32_t(uint32_t));
65     MOCK_METHOD1(UpdateKeyContext, int32_t(uint32_t));
66     MOCK_METHOD3(CreateShareFile, std::vector<int32_t> (const std::vector<std::string> &, uint32_t, uint32_t));
67     MOCK_METHOD2(DeleteShareFile, int32_t (uint32_t, const std::vector<std::string> &));
68     MOCK_METHOD1(LockUserScreen, int32_t(uint32_t));
69     MOCK_METHOD3(UnlockUserScreen, int32_t(uint32_t, const std::vector<uint8_t> &, const std::vector<uint8_t> &));
70     MOCK_METHOD2(GetLockScreenStatus, int32_t(uint32_t, bool &));
71     MOCK_METHOD4(MountDfsDocs, int32_t(int32_t, const std::string &, const std::string &, const std::string &));
72     MOCK_METHOD4(UMountDfsDocs, int32_t(int32_t, const std::string &, const std::string &, const std::string &));
73     MOCK_METHOD2(UpdateMemoryPara, int32_t (int32_t, int32_t &));
74     MOCK_METHOD5(GetBundleStatsForIncrease, int32_t(uint32_t, const std::vector<std::string> &,
75         const std::vector<int64_t> &, std::vector<int64_t> &, std::vector<int64_t> &));
76     MOCK_METHOD3(GenerateAppkey, int32_t(uint32_t, uint32_t, std::string &));
77     MOCK_METHOD4(SetBundleQuota, int32_t(const std::string &, int32_t, const std::string &, int32_t));
78     MOCK_METHOD1(DeleteAppkey, int32_t(const std::string keyId));
79     MOCK_METHOD3(GetFileEncryptStatus, int32_t(uint32_t, bool &, bool));
80     MOCK_METHOD2(GetUserNeedActiveStatus, int32_t(uint32_t, bool &));
81 };
82 }  // namespace StorageManager
83 }  // namespace OHOS
84 #endif /* MOCK_STORAGE_MANAGER_STUB_H */