• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 TransSdkStreamTest : public testing::Test {
25 public:
TransSdkStreamTest()26     TransSdkStreamTest()
27     {}
~TransSdkStreamTest()28     ~TransSdkStreamTest()
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 TransSdkStreamTest::SetUpTestCase(void)
39 {}
40 
TearDownTestCase(void)41 void TransSdkStreamTest::TearDownTestCase(void)
42 {}
43 
44 /**
45  * @tc.name: SendStreamTest001
46  * @tc.desc: extern module active publish, use the wrong parameter.
47  * @tc.type: FUNC
48  * @tc.require: I5FG70
49  */
50 HWTEST_F(TransSdkStreamTest, SendStreamTest001, TestSize.Level1)
51 {
52     int32_t ret;
53     int32_t sessionId = 1;
54     const StreamData streamData = {0};
55     const StreamData ext = {0};
56     const StreamFrameInfo param = {0};
57 
58     ret = SendStream(-1, &streamData, &ext, &param);
59     EXPECT_NE(SOFTBUS_OK, ret);
60 
61     ret = SendStream(sessionId, nullptr, &ext, &param);
62     EXPECT_NE(SOFTBUS_OK, ret);
63 
64     ret = SendStream(sessionId, &streamData, nullptr, &param);
65     EXPECT_NE(SOFTBUS_OK, ret);
66 
67     ret = SendStream(sessionId, &streamData, &ext, nullptr);
68     EXPECT_NE(SOFTBUS_OK, ret);
69 }
70 }