• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2021-2024 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 "runtime/tests/pygote_space_allocator_test_base.h"
17 
18 namespace ark::mem {
19 
20 class PygoteSpaceAllocatorGenTest : public PygoteSpaceAllocatorTest {
21 public:
22     NO_COPY_SEMANTIC(PygoteSpaceAllocatorGenTest);
23     NO_MOVE_SEMANTIC(PygoteSpaceAllocatorGenTest);
24 
PygoteSpaceAllocatorGenTest()25     PygoteSpaceAllocatorGenTest()
26     {
27         // Logger::InitializeStdLogging(Logger::Level::DEBUG, Logger::Component::ALL);
28         options_.SetShouldLoadBootPandaFiles(false);
29         options_.SetShouldInitializeIntrinsics(false);
30         options_.SetStartAsZygote(true);
31         options_.SetGcType("gen-gc");
32         options_.SetExplicitConcurrentGcEnabled(false);
33         Runtime::Create(options_);
34         thread_ = ark::MTManagedThread::GetCurrent();
35         thread_->ManagedCodeBegin();
36     }
37 
~PygoteSpaceAllocatorGenTest()38     ~PygoteSpaceAllocatorGenTest() override
39     {
40         // Logger::Destroy();
41         thread_->ManagedCodeEnd();
42         Runtime::Destroy();
43     }
44 };
45 
TEST_F(PygoteSpaceAllocatorGenTest,InitAllocTest)46 TEST_F(PygoteSpaceAllocatorGenTest, InitAllocTest)
47 {
48     InitAllocTest();
49 }
50 
TEST_F(PygoteSpaceAllocatorGenTest,ForkedAllocTest)51 TEST_F(PygoteSpaceAllocatorGenTest, ForkedAllocTest)
52 {
53     ForkedAllocTest();
54 }
55 
TEST_F(PygoteSpaceAllocatorGenTest,NonMovableLiveObjectAllocTest)56 TEST_F(PygoteSpaceAllocatorGenTest, NonMovableLiveObjectAllocTest)
57 {
58     NonMovableLiveObjectAllocTest();
59 }
60 
TEST_F(PygoteSpaceAllocatorGenTest,NonMovableUnliveObjectAllocTest)61 TEST_F(PygoteSpaceAllocatorGenTest, NonMovableUnliveObjectAllocTest)
62 {
63     NonMovableUnliveObjectAllocTest();
64 }
65 
TEST_F(PygoteSpaceAllocatorGenTest,MovableLiveObjectAllocTest)66 TEST_F(PygoteSpaceAllocatorGenTest, MovableLiveObjectAllocTest)
67 {
68     MovableLiveObjectAllocTest();
69 }
70 
TEST_F(PygoteSpaceAllocatorGenTest,MovableUnliveObjectAllocTest)71 TEST_F(PygoteSpaceAllocatorGenTest, MovableUnliveObjectAllocTest)
72 {
73     MovableUnliveObjectAllocTest();
74 }
75 
TEST_F(PygoteSpaceAllocatorGenTest,MuchObjectAllocTest)76 TEST_F(PygoteSpaceAllocatorGenTest, MuchObjectAllocTest)
77 {
78     MuchObjectAllocTest();
79 }
80 
81 }  // namespace ark::mem
82