• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <gtest/gtest.h>
17 
18 #include "session.h"
19 #include "softbus_error_code.h"
20 
21 using namespace testing::ext;
22 
23 namespace OHOS {
24 class TransSdkCommStreamTest : public testing::Test {
25 public:
TransSdkCommStreamTest()26     TransSdkCommStreamTest()
27     {}
~TransSdkCommStreamTest()28     ~TransSdkCommStreamTest()
29     {}
30     static void SetUpTestCase(void);
31     static void TearDownTestCase(void);
SetUp()32     void SetUp() override
33     {}
TearDown()34     void TearDown() override
35     {}
36 };
37 
SetUpTestCase(void)38 void TransSdkCommStreamTest::SetUpTestCase(void)
39 {}
40 
TearDownTestCase(void)41 void TransSdkCommStreamTest::TearDownTestCase(void)
42 {}
43 
44 /**
45  * @tc.name: SendCommStreamTest001
46  * @tc.desc: start common stream client, send wrong param.
47  * @tc.type: FUNC
48  * @tc.require: I5KRE8
49  */
50 HWTEST_F(TransSdkCommStreamTest, SendCommStreamTest001, TestSize.Level1)
51 {
52     int32_t sessionId = 1;
53     const StreamData streamData = {0};
54     const StreamData extData = {0};
55     const StreamFrameInfo frameInfo = {0};
56 
57     int32_t ret = SendStream(-1, &streamData, &extData, &frameInfo);
58     EXPECT_NE(SOFTBUS_OK, ret);
59 
60     ret = SendStream(sessionId, nullptr, &extData, &frameInfo);
61     EXPECT_NE(SOFTBUS_OK, ret);
62 }
63 }