1 /* 2 * Copyright (c) 2022 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_PROCESS_COMMUNICATOR_H 16 #define MOCK_PROCESS_COMMUNICATOR_H 17 #include <gmock/gmock.h> 18 #include "iprocess_communicator.h" 19 20 namespace DistributedDB { 21 class MockProcessCommunicator : public IProcessCommunicator { 22 public: 23 MOCK_METHOD1(Start, DBStatus(const std::string &)); 24 MOCK_METHOD0(Stop, DBStatus()); 25 MOCK_METHOD1(RegOnDeviceChange, DBStatus(const OnDeviceChange &)); 26 MOCK_METHOD1(RegOnDataReceive, DBStatus(const OnDataReceive &)); 27 MOCK_METHOD3(SendData, DBStatus(const DeviceInfos &, const uint8_t *, uint32_t)); 28 MOCK_METHOD0(GetMtuSize, uint32_t()); 29 MOCK_METHOD0(GetTimeout, uint32_t()); 30 MOCK_METHOD0(GetLocalDeviceInfos, DeviceInfos()); 31 MOCK_METHOD0(GetRemoteOnlineDeviceInfosList, std::vector<DeviceInfos>()); 32 MOCK_METHOD1(IsSameProcessLabelStartedOnPeerDevice, bool(const DeviceInfos &)); 33 MOCK_METHOD4(CheckAndGetDataHeadInfo, DBStatus(const uint8_t *, uint32_t, uint32_t &, 34 std::vector<std::string> &)); 35 }; 36 } 37 #endif // MOCK_PROCESS_COMMUNICATOR_H 38