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 16 #ifndef OHOS_SOFTBUS_ADAPTER_TEST_H 17 #define OHOS_SOFTBUS_ADAPTER_TEST_H 18 19 #include <gtest/gtest.h> 20 #include <securec.h> 21 22 #include "softbus_bus_center.h" 23 #include "softbus_common.h" 24 25 #include "dscreen_constants.h" 26 #include "dscreen_errcode.h" 27 #include "dscreen_util.h" 28 #include "isoftbus_listener.h" 29 #define private public 30 #include "softbus_adapter.h" 31 #undef private 32 33 namespace OHOS { 34 namespace DistributedHardware { 35 class SoftbusAdapterTest : public testing::Test { 36 public: 37 static void SetUpTestCase(void); 38 static void TearDownTestCase(void); 39 void SetUp(); 40 void TearDown(); 41 42 SoftbusAdapter softbusAdapter; 43 }; 44 class MockSoftbusListener : public ISoftbusListener { 45 public: 46 MockSoftbusListener() = default; 47 ~MockSoftbusListener() = default; OnSessionOpened(int32_t sessionId,int32_t result)48 void OnSessionOpened(int32_t sessionId, int32_t result) override {} OnSessionClosed(int32_t sessionId)49 void OnSessionClosed(int32_t sessionId) override {} OnBytesReceived(int32_t sessionId,const void * data,uint32_t dataLen)50 void OnBytesReceived(int32_t sessionId, const void *data, uint32_t dataLen) override {} OnStreamReceived(int32_t sessionId,const StreamData * data,const StreamData * ext,const StreamFrameInfo * param)51 void OnStreamReceived(int32_t sessionId, const StreamData *data, const StreamData *ext, 52 const StreamFrameInfo *param) override {} 53 }; 54 } // namespace DistributedHardware 55 } // namespace OHOS 56 #endif