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