1 /*
2  * Copyright (c) 2023 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 #include <thread>
18 #include "eu/cpu_monitor.h"
19 #include "eu/cpu_worker.h"
20 #include "eu/scpuworker_manager.h"
21 #include "eu/cpu_manager_strategy.h"
22 #include "eu/worker_thread.h"
23 #include "qos.h"
24 #include "common.h"
25 
26 using namespace testing;
27 #ifdef HWTEST_TESTING_EXT_ENABLE
28 using namespace testing::ext;
29 #endif
30 using namespace ffrt;
31 using namespace std;
32 
33 
34 class CpuworkerManagerTest : public testing::Test {
35 protected:
SetUpTestCase()36     static void SetUpTestCase()
37     {
38     }
39 
TearDownTestCase()40     static void TearDownTestCase()
41     {
42     }
43 
SetUp()44     virtual void SetUp()
45     {
46     }
47 
TearDown()48     virtual void TearDown()
49     {
50     }
51 };
52 
53 /**
54  * @tc.name: NotifyTaskAdded
55  * @tc.desc: Test whether the NotifyTaskAdded interface are normal.
56  * @tc.type: FUNC
57  */
58 HWTEST_F(CpuworkerManagerTest, NotifyTaskAdded, TestSize.Level1)
59 {
60     auto *it = new SCPUWorkerManager();
61     it->NotifyTaskAdded(QoS(qos(5)));
62 }
63