From e4b75338794768ba31ca3d1501a528e59ccee6e9 Mon Sep 17 00:00:00 2001 From: sannikov Date: Wed, 1 Mar 2023 19:40:48 +0300 Subject: [PATCH] [MM] fix clang-tidy issues in tests Signed-off-by: sannikov --- tests/runtime/mem/g1gc_barrier_test.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/runtime/mem/g1gc_barrier_test.cpp b/tests/runtime/mem/g1gc_barrier_test.cpp index 268da1288..cbf50c215 100644 --- a/tests/runtime/mem/g1gc_barrier_test.cpp +++ b/tests/runtime/mem/g1gc_barrier_test.cpp @@ -18,7 +18,7 @@ namespace panda::ecmascript { class G1GCBarrierTest : public testing::Test { public: - explicit G1GCBarrierTest(size_t promotion_region_alive_rate = 100) + explicit G1GCBarrierTest(size_t promotion_region_alive_rate = PERCENT_100_U32) { RuntimeOptions options; options.SetBootClassSpaces({"ecmascript"}); @@ -41,7 +41,10 @@ public: array_class_ = JSHClass::Cast(globalConst->GetArrayClass().GetTaggedObject()); } - ~G1GCBarrierTest() + NO_COPY_SEMANTIC(G1GCBarrierTest); + NO_MOVE_SEMANTIC(G1GCBarrierTest); + + ~G1GCBarrierTest() override { Runtime::Destroy(); } @@ -62,7 +65,8 @@ public: return array; } - JSThread *thread_; + JSThread *thread_; // NOLINT(misc-non-private-member-variables-in-classes) +private: JSHClass *array_class_; JSHClass *string_class_; }; @@ -94,11 +98,12 @@ public: EXPECT_EQ(object_.GetObject(), pre_buff->front()); } + bool has_concurrent_mark = false; // NOLINT(misc-non-private-member-variables-in-classes) +private: G1GCBarrierTest *test_; JSHandle array_; JSHandle object_; JSHandle replacement_; - bool has_concurrent_mark = false; }; TEST_F(G1GCBarrierTest, TestPreBarrier) @@ -140,7 +145,10 @@ public: thread_ = JSThread::GetCurrent(); } - ~G1GCClassCollectionTest() + NO_COPY_SEMANTIC(G1GCClassCollectionTest); + NO_MOVE_SEMANTIC(G1GCClassCollectionTest); + + ~G1GCClassCollectionTest() override { Runtime::Destroy(); } @@ -160,7 +168,7 @@ public: return static_cast *>(gc->GetObjectAllocator()); } - JSThread *thread_; + JSThread *thread_; // NOLINT(misc-non-private-member-variables-in-classes) }; TEST_P(G1GCClassCollectionTest, TestCollectClasses) -- Gitee