From 44ab8c5918f4317a7d5de9b73ed411716aa42dba Mon Sep 17 00:00:00 2001 From: lina123456 Date: Mon, 10 Jul 2023 21:03:25 +0800 Subject: [PATCH] fixed 4821f42 from https://gitee.com/lina123456/xts_acts/pulls/9269 Signed-off-by: lina123456 --- .../main/ets/test/PasteBoardRecord.test.ets | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoardRecord.test.ets b/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoardRecord.test.ets index 52c392e97..74ef60886 100644 --- a/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoardRecord.test.ets +++ b/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoardRecord.test.ets @@ -710,7 +710,7 @@ export default function pasteBoardRecordTest(){ /** * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_ADDRECORD_1100 * @tc.name AddData - * @tc.desc Test pasteBoard add 613th record fail + * @tc.desc Test pasteBoard add 613th record successful * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 2 @@ -754,6 +754,32 @@ export default function pasteBoardRecordTest(){ expect(error != undefined).assertTrue(); console.info("SUB_PASTEBOARD_FUNCTION_ETS_ADDRECORD_1200 end") done(); + }) + + /** + * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_ADDRECORD_1300 + * @tc.name AddData + * @tc.desc Test pasteBoard add 613th record successful + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 2 + */ + it('SUB_PASTEBOARD_FUNCTION_ETS_ADDRECORD_1300', 0, async function (done) { + console.info("SUB_PASTEBOARD_FUNCTION_ETS_ADDRECORD_1300 start") + let pasteData = pasteboard.createData("string",ARRAY_BUFFER) + for(var i = 0; i < 998; i++){ + pasteData.addRecord("stringRecord" + i, ARRAY_BUFFER); + } + try{ + pasteData.addRecord("stringRecord1000", ARRAY_BUFFER); + }catch(err){ + console.info("Add record error, err code is: " + err.code) + expect(err!=undefined).assertFail(); + } + let hasType = pasteData.hasType("stringRecord1000") + expect(hasType == true).assertTrue(); + console.info("SUB_PASTEBOARD_FUNCTION_ETS_ADDRECORD_1300 end") + done(); }) }); } -- GitLab