• 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 #include "gtest/gtest.h"
17 
18 #include "utils.h"
19 
20 #define private public
21 #define protected public
22 #include "mem_mgr_client.h"
23 #include "bundle_priority_list.h"
24 #include "mem_mgr_constant.h"
25 #undef private
26 #undef protected
27 
28 namespace OHOS {
29 namespace Memory {
30 using namespace testing;
31 using namespace testing::ext;
32 
33 class InnerkitsTest : public testing::Test {
34 public:
35     static void SetUpTestCase();
36     static void TearDownTestCase();
37     void SetUp();
38     void TearDown();
39 };
40 
SetUpTestCase()41 void InnerkitsTest::SetUpTestCase()
42 {
43 }
44 
TearDownTestCase()45 void InnerkitsTest::TearDownTestCase()
46 {
47 }
48 
SetUp()49 void InnerkitsTest::SetUp()
50 {
51 }
52 
TearDown()53 void InnerkitsTest::TearDown()
54 {
55 }
56 
57 HWTEST_F(InnerkitsTest, GetBundlePriorityList_Test, TestSize.Level1)
58 {
59     BundlePriorityList bundlePrioList;
60     int32_t ret = MemMgrClient::GetInstance().GetBundlePriorityList(bundlePrioList);
61     EXPECT_EQ(ret, 0);
62     bundlePrioList.Show();
63 }
64 
65 HWTEST_F(InnerkitsTest, GetPriorityDescTest, TestSize.Level1)
66 {
67     auto ptr = ReclaimPriorityMapping.find(RECLAIM_PRIORITY_SYSTEM);
68     EXPECT_EQ(ptr->second, "System");
69 }
70 
71 HWTEST_F(InnerkitsTest, NotifyDistDevStatus_Test, TestSize.Level1)
72 {
73     int32_t ret = MemMgrClient::GetInstance().NotifyDistDevStatus(123, 456, "dist_dev_test", true);
74     EXPECT_EQ(ret, 0);
75 }
76 }
77 }
78