mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
cherry pick 7395f95
from https://gitee.com/littlehjg/arkcompiler_ets_runtime/pulls/9887
修改BitVector UT用例,新增边界值检测 Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAYTUD Signed-off-by: tangbin <2387440390@qq.com>
This commit is contained in:
parent
ec3b71e270
commit
e2a7eb5331
@ -232,6 +232,31 @@ HWTEST_F_L0(JSAPIBitVectorTest, Has_instance)
|
||||
EXPECT_TRUE(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: Has_Testboundary
|
||||
* @tc.desc:
|
||||
* @tc.type: FUNC
|
||||
* @tc.require:
|
||||
*/
|
||||
HWTEST_F_L0(JSAPIBitVectorTest, Has_Testboundary)
|
||||
{
|
||||
uint32_t increasedLength = 8;
|
||||
JSHandle<JSAPIBitVector> bitVector(thread, CreateBitVector());
|
||||
for (uint32_t i = 0; i < increasedLength; i++) {
|
||||
JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1));
|
||||
JSAPIBitVector::Push(thread, bitVector, value);
|
||||
}
|
||||
JSHandle<JSTaggedValue> value(thread, JSTaggedValue(0));
|
||||
JSHandle<JSTaggedValue> value1(thread, JSTaggedValue(7));
|
||||
bool res = JSAPIBitVector::Has(thread, bitVector, value, value, value1);
|
||||
EXPECT_FALSE(res);
|
||||
JSHandle<JSTaggedValue> value2(thread, JSTaggedValue(1));
|
||||
JSHandle<JSTaggedValue> value3(thread, JSTaggedValue(8));
|
||||
JSAPIBitVector::Push(thread, bitVector, value2);
|
||||
res = JSAPIBitVector::Has(thread, bitVector, value2, value, value3);
|
||||
EXPECT_TRUE(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: SetBitsByRange
|
||||
* @tc.desc:
|
||||
|
Loading…
Reference in New Issue
Block a user