From 0c953d3b01941d78580c645eefad5b978eeef535 Mon Sep 17 00:00:00 2001 From: lhc Date: Thu, 7 Aug 2025 16:16:10 +0800 Subject: [PATCH] Add Unified_GC_Test test case Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/ICRV1H?from=project-issue Signed-off-by: lhc Change-Id: Iee0bb75c74390f4222a45f2ecf66cf613adfc62c --- ecmascript/tests/BUILD.gn | 2 ++ ecmascript/tests/unified_gc_test.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ecmascript/tests/BUILD.gn b/ecmascript/tests/BUILD.gn index d24b8504d2..f8c23ea6ae 100644 --- a/ecmascript/tests/BUILD.gn +++ b/ecmascript/tests/BUILD.gn @@ -3630,6 +3630,7 @@ group("unittest") { ":Sendable_JsSendableArrayBuffer_Test", ":Sendable_JsSharedArray_Test", ":Sendable_SharedObjectFactory_Test", + ":Unified_GC_Test", ] # TODO: CMC-GC UT FIX LATER @@ -3803,6 +3804,7 @@ group("host_unittest") { ":Sendable_JsSendableArrayBuffer_TestAction", ":Sendable_JsSharedArray_TestAction", ":Sendable_SharedObjectFactory_TestAction", + ":Unified_GC_TestAction", ] if (is_mac) { diff --git a/ecmascript/tests/unified_gc_test.cpp b/ecmascript/tests/unified_gc_test.cpp index 2ac5010164..5e3f14b1fd 100644 --- a/ecmascript/tests/unified_gc_test.cpp +++ b/ecmascript/tests/unified_gc_test.cpp @@ -53,8 +53,8 @@ HWTEST_F_L0(UnifiedGCTest, UnifiedGCMarkRootsScopeTest) } [[maybe_unused]] UnifiedGCMarkRootsScope unifiedGCMarkRootsScope(thread); vm->CollectGarbage(TriggerGCType::FULL_GC); - EXPECT_TRUE(weakRefArray->Get(INT_VALUE_0).IsUndefined()); - EXPECT_TRUE(!weakRefArray->Get(INT_VALUE_1).IsUndefined()); + EXPECT_TRUE(weakRefArray->Get(thread, INT_VALUE_0).IsUndefined()); + EXPECT_TRUE(!weakRefArray->Get(thread, INT_VALUE_1).IsUndefined()); vm->SetEnableForceGC(true); } -- Gitee