From d41a320483d995d8fd3973f82fef2c6df435107f Mon Sep 17 00:00:00 2001 From: yanzhiqi1 Date: Mon, 8 Sep 2025 15:40:24 +0800 Subject: [PATCH] add ut for IsAlive Issue: #ICWWX1 Signed-off-by: yanzhiqi1 Change-Id: I100c7961d9a27159d01b7f60aa723cd0b407deef --- ecmascript/tests/js_verification_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ecmascript/tests/js_verification_test.cpp b/ecmascript/tests/js_verification_test.cpp index 7153b809ec..e923696ce9 100644 --- a/ecmascript/tests/js_verification_test.cpp +++ b/ecmascript/tests/js_verification_test.cpp @@ -56,6 +56,12 @@ HWTEST_F_L0(JSVerificationTest, ContainObject) // no movable object auto nonMovableArray = objectFactory->NewTaggedArray(2, JSTaggedValue::Undefined(), MemSpaceType::NON_MOVABLE); funcVerify(*nonMovableArray, verifier, heap); + + // not alive + JSTaggedValue arrayVal = oldArray.GetTaggedValue(); + heap->CollectGarbage(panda::ecmascript::TriggerGCType::FULL_GC); + EXPECT_FALSE(heap->ContainObject(arrayVal.GetTaggedObject())); + EXPECT_FALSE(heap->IsAlive(arrayVal.GetTaggedObject())); } HWTEST_F_L0(JSVerificationTest, VerifyHeapObjects) -- Gitee