• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "core/task_ctx.h"
19 #include "eu/cpu_monitor.h"
20 #include "eu/cpu_worker.h"
21 #include "eu/cpuworker_manager.h"
22 #include "eu/cpu_manager_interface.h"
23 #include "eu/worker_thread.h"
24 #include "sched/qos.h"
25 
26 using namespace testing;
27 using namespace testing::ext;
28 using namespace ffrt;
29 using namespace std;
30 
31 
32 class CpuworkerManagerTest : public testing::Test {
33 protected:
SetUpTestCase()34     static void SetUpTestCase()
35     {
36     }
37 
TearDownTestCase()38     static void TearDownTestCase()
39     {
40     }
41 
SetUp()42     virtual void SetUp()
43     {
44     }
45 
TearDown()46     virtual void TearDown()
47     {
48     }
49 };
50 
51 /**
52  * @tc.name: NotifyTaskAdded
53  * @tc.desc: Test whether the NotifyTaskAdded interface are normal.
54  * @tc.type: FUNC
55  */
56 HWTEST_F(CpuworkerManagerTest, NotifyTaskAdded, TestSize.Level1)
57 {
58     auto *it = new CPUWorkerManager();
59     it->NotifyTaskAdded(qos(5));
60 }
61