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 #include "concurrent_task_service.h"
18 #include "concurrent_task_controller.h"
19
20 namespace OHOS {
21 namespace FFRT_TEST {
22 using namespace testing;
23 using namespace testing::ext;
24 using namespace OHOS::ConcurrentTask;
25
26
27 class ConcurrentTaskServiceTest : public testing::Test {
28 public:
29 static void SetUpTestCase();
30 static void TearDownTestCase();
31 void SetUp();
32 void TearDown();
33 };
34
SetUpTestCase()35 void ConcurrentTaskServiceTest::SetUpTestCase()
36 {
37 }
38
TearDownTestCase()39 void ConcurrentTaskServiceTest::TearDownTestCase()
40 {
41 }
42
SetUp()43 void ConcurrentTaskServiceTest::SetUp()
44 {
45 }
46
TearDown()47 void ConcurrentTaskServiceTest::TearDown()
48 {
49 }
50
51 /**
52 * @tc.name: QueryIntervalTest
53 * @tc.desc: Test whether the QueryInterval interface are normal.
54 * @tc.type: FUNC
55 */
56 HWTEST_F(ConcurrentTaskServiceTest, QueryIntervalTest, TestSize.Level1)
57 {
58 int queryItem = 0;
59 IntervalReply queryRs = {87, 657, 357, 214};
60 ConcurrentTaskService queInt;
61 queInt.QueryInterval(queryItem, queryRs);
62 }
63
64 /**
65 * @tc.name: QueryDeadlineTest
66 * @tc.desc: Test whether the QueryDeadline interface are normal.
67 * @tc.type: FUNC
68 */
69 HWTEST_F(ConcurrentTaskServiceTest, QueryDeadlineTest, TestSize.Level1)
70 {
71 int queryItem = 0;
72 DeadlineReply ddlReply = { false };
73 Json::Value payload;
74 payload["1111"] = "60";
75 payload["2222"] = "90";
76 ConcurrentTaskService queInt;
77 queInt.QueryDeadline(queryItem, ddlReply, payload);
78 }
79 }
80 }