1 /* 2 * Copyright (c) 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 16 #ifndef LNN_NET_BUILDER_MOCK_H 17 #define LNN_NET_BUILDER_MOCK_H 18 19 #include <gmock/gmock.h> 20 #include <mutex> 21 22 #include "lnn_net_builder.h" 23 24 namespace OHOS { 25 class LnnNetBuilderInterface { 26 public: LnnNetBuilderInterface()27 LnnNetBuilderInterface() {}; ~LnnNetBuilderInterface()28 virtual ~LnnNetBuilderInterface() {}; 29 30 virtual int32_t LnnRequestLeaveSpecific(const char *networkId, ConnectionAddrType addrType) = 0; 31 virtual int32_t LnnSetDLConnUserId(const char *networkId, int32_t userId) = 0; 32 virtual int32_t LnnSetDLConnUserIdCheckSum(const char *networkId, int32_t userIdCheckSum) = 0; 33 }; 34 35 class LnnNetBuilderInterfaceMock : public LnnNetBuilderInterface { 36 public: 37 LnnNetBuilderInterfaceMock(); 38 ~LnnNetBuilderInterfaceMock() override; 39 40 MOCK_METHOD2(LnnRequestLeaveSpecific, int32_t(const char *, ConnectionAddrType)); 41 MOCK_METHOD2(LnnSetDLConnUserId, int32_t(const char *networkId, int32_t userId)); 42 MOCK_METHOD2(LnnSetDLConnUserIdCheckSum, int32_t(const char *networkId, int32_t userIdCheckSum)); 43 }; 44 } // namespace OHOS 45 #endif // LNN_NET_BUILDER_MOCK_H 46