• 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 "common/include/task_scheduler.h"
17 #include <gtest/gtest.h>
18 
19 using namespace testing;
20 using namespace testing::ext;
21 namespace OHOS {
22 namespace Rosen {
23 class TaskSchedulerText : public testing::Test {
24   public:
TaskSchedulerText()25     TaskSchedulerText() {}
~TaskSchedulerText()26     ~TaskSchedulerText() {}
27 };
28 
29 namespace {
30 /**
31  * @tc.name: task_scheduler_test001
32  * @tc.desc: normal function
33  * @tc.type: FUNC
34  */
35 HWTEST_F(TaskSchedulerText, task_scheduler_test001, Function | SmallTest | Level2)
36 {
37     GTEST_LOG_(INFO) << "TaskSchedulerText: task_scheduler_test001 start";
38     std::string threadName = "threadName";
39     std::string name = "name";
40     TaskScheduler* taskScheduler = new(std::nothrow) TaskScheduler(threadName);
41     int res = 0;
42     taskScheduler->RemoveTask(name);
43     ASSERT_EQ(res, 0);
44     delete taskScheduler;
45     GTEST_LOG_(INFO) << "TaskSchedulerText: task_scheduler_test001 end";
46 }
47 } // namespace
48 } // namespace Rosen
49 } // namespace OHOS
50