• 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_errcode.h"
20 
21 using namespace testing::ext;
22 
23 namespace OHOS {
24 const int32_t G_VALID_SESSION_ID = 1;
25 const int32_t G_INVALID_SESSION_ID = 1;
26 const int32_t G_VALID_APP_TYPE = 1;
27 
28 class TransQosTest : public testing::Test {
29 public:
TransQosTest()30     TransQosTest()
31     {}
~TransQosTest()32     ~TransQosTest()
33     {}
34     static void SetUpTestCase(void);
35     static void TearDownTestCase(void);
SetUp()36     void SetUp() override
37     {}
TearDown()38     void TearDown() override
39     {}
40 };
41 
SetUpTestCase(void)42 void TransQosTest::SetUpTestCase(void)
43 {}
44 
TearDownTestCase(void)45 void TransQosTest::TearDownTestCase(void)
46 {}
47 
48 /**
49  * @tc.name: TransQosTest001
50  * @tc.desc: test the wrong parameter.
51  * @tc.type: FUNC
52  * @tc.require:
53  */
54 HWTEST_F(TransQosTest, QosReportTest001, TestSize.Level0)
55 {
56     int ret;
57     ret = QosReport(G_INVALID_SESSION_ID, G_VALID_APP_TYPE, QOS_IMPROVE);
58     EXPECT_NE(ret, SOFTBUS_OK);
59 
60     ret = QosReport(G_VALID_SESSION_ID, G_VALID_APP_TYPE, QOS_RECOVER);
61     EXPECT_NE(ret, SOFTBUS_OK);
62 
63     ret = QosReport(G_VALID_SESSION_ID, G_VALID_APP_TYPE, QOS_IMPROVE);
64     EXPECT_NE(ret, SOFTBUS_OK);
65 }
66 } // namespace OHOS
67