1 /*
2  * Copyright (c) 2022-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 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 #include "softbus_adapter.h"
30 
31 namespace OHOS {
32 namespace DistributedHardware {
33 class SoftbusAdapterTest : public testing::Test {
34 public:
35     static void SetUpTestCase(void);
36     static void TearDownTestCase(void);
37     void SetUp();
38     void TearDown();
39 
40     SoftbusAdapter softbusAdapter;
41     uint64_t tokenId_;
42 };
43 class MockSoftbusListener : public ISoftbusListener {
44 public:
45     MockSoftbusListener() = default;
46     ~MockSoftbusListener() = default;
OnSessionOpened(int32_t sessionId,PeerSocketInfo info)47     void OnSessionOpened(int32_t sessionId, PeerSocketInfo info) override {}
OnSessionClosed(int32_t sessionId,ShutdownReason reason)48     void OnSessionClosed(int32_t sessionId, ShutdownReason reason) override {}
OnBytesReceived(int32_t sessionId,const void * data,uint32_t dataLen)49     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)50     void OnStreamReceived(int32_t sessionId, const StreamData *data, const StreamData *ext,
51         const StreamFrameInfo *param) override {}
52 };
53 } // namespace DistributedHardware
54 } // namespace OHOS
55 #endif