• 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 #define private public
17 #define protected public
18 #undef private
19 #undef protected
20 
21 #include <gtest/gtest.h>
22 #include "socperf_client.h"
23 #include "socperf.h"
24 #include "iservice_registry.h"
25 #include "system_ability_definition.h"
26 
27 using namespace testing::ext;
28 
29 namespace OHOS {
30 namespace SOCPERF {
31 class SocPerfSubTest : public testing::Test {
32 public:
33     static void SetUpTestCase(void);
34     static void TearDownTestCase(void);
35     void SetUp();
36     void TearDown();
37 };
38 
SetUpTestCase(void)39 void SocPerfSubTest::SetUpTestCase(void)
40 {
41 }
42 
TearDownTestCase(void)43 void SocPerfSubTest::TearDownTestCase(void)
44 {
45 }
46 
SetUp(void)47 void SocPerfSubTest::SetUp(void)
48 {
49 }
50 
TearDown(void)51 void SocPerfSubTest::TearDown(void)
52 {
53 }
54 
55 /*
56  * @tc.name: SocPerfSubTest_PerfRequest_001
57  * @tc.desc: PerfRequest
58  * @tc.type FUNC
59  * @tc.require: issueI78T3V
60  */
61 HWTEST_F(SocPerfSubTest, SocPerfSubTest_PerfRequest_001, Function | MediumTest | Level0)
62 {
63     OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequest(10000, "");
64     OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequest(10000, "123");
65 }
66 
67 /*
68  * @tc.name: SocPerfSubTest_PerfRequest_002
69  * @tc.desc: PerfRequestEx ON
70  * @tc.type FUNC
71  * @tc.require: issueI78T3V
72  */
73 HWTEST_F(SocPerfSubTest, SocPerfSubTest_PerfRequest_002, Function | MediumTest | Level0)
74 {
75     OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequestEx(10000, true, "");
76     OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequestEx(10000, true, "123");
77 }
78 
79 /*
80  * @tc.name: SocPerfSubTest_PerfRequest_003
81  * @tc.desc: PerfRequestEx OFF
82  * @tc.type FUNC
83  * @tc.require: issueI78T3V
84  */
85 HWTEST_F(SocPerfSubTest, SocPerfSubTest_PerfRequest_003, Function | MediumTest | Level0)
86 {
87     OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequestEx(10000, false, "");
88     OHOS::SOCPERF::SocPerfClient::GetInstance().PerfRequestEx(10000, false, "123");
89 }
90 
91 /*
92  * @tc.name: SocPerfSubTest_PowerLimitBoost_001
93  * @tc.desc: PowerLimitBoost ON
94  * @tc.type FUNC
95  * @tc.require: issueI78T3V
96  */
97 HWTEST_F(SocPerfSubTest, SocPerfSubTest_PowerLimitBoost_001, Function | MediumTest | Level0)
98 {
99     OHOS::SOCPERF::SocPerfClient::GetInstance().PowerLimitBoost(true, "");
100     OHOS::SOCPERF::SocPerfClient::GetInstance().PowerLimitBoost(true, "123");
101 }
102 
103 /*
104  * @tc.name: SocPerfSubTest_PowerLimitBoost_001
105  * @tc.desc: PowerLimitBoost OFF
106  * @tc.type FUNC
107  * @tc.require: issueI78T3V
108  */
109 HWTEST_F(SocPerfSubTest, SocPerfSubTest_PowerLimitBoost_002, Function | MediumTest | Level0)
110 {
111     OHOS::SOCPERF::SocPerfClient::GetInstance().PowerLimitBoost(false, "");
112     OHOS::SOCPERF::SocPerfClient::GetInstance().PowerLimitBoost(false, "123");
113 }
114 
115 /*
116  * @tc.name: SocPerfSubTest_ThermalLimitBoost_001
117  * @tc.desc: ThermalLimitBoost ON
118  * @tc.type FUNC
119  * @tc.require: issueI78T3V
120  */
121 HWTEST_F(SocPerfSubTest, SocPerfSubTest_ThermalLimitBoost_001, Function | MediumTest | Level0)
122 {
123     OHOS::SOCPERF::SocPerfClient::GetInstance().ThermalLimitBoost(true, "");
124     OHOS::SOCPERF::SocPerfClient::GetInstance().ThermalLimitBoost(true, "123");
125 }
126 
127 /*
128  * @tc.name: SocPerfSubTest_ThermalLimitBoost_002
129  * @tc.desc: ThermalLimitBoost OFF
130  * @tc.type FUNC
131  * @tc.require: issueI78T3V
132  */
133 HWTEST_F(SocPerfSubTest, SocPerfSubTest_ThermalLimitBoost_002, Function | MediumTest | Level0)
134 {
135     OHOS::SOCPERF::SocPerfClient::GetInstance().ThermalLimitBoost(false, "");
136     OHOS::SOCPERF::SocPerfClient::GetInstance().ThermalLimitBoost(false, "123");
137 }
138 } // namespace SOCPERF
139 } // namespace OHOS