提交 23a9ff65 编写于 作者: C caochuan

fixed 7fa3a5b8 from https://gitee.com/neusoft_group_co_ltd_cc/xts_acts_dr/pulls/6451

fix assert & add title modify testcase

expect.assertFail() -> expect().assertFail()
Signed-off-by: Ncaochuan <caochuan@huawei.com>
Change-Id: I837997cfcc741e8a5af198dff024a924f38bce62
上级 9adc88d7
...@@ -133,7 +133,7 @@ export default function mediaLibraryTestCallback(abilityContext) { ...@@ -133,7 +133,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
fetchFileResult.getFirstObject(async (err, asset) => { fetchFileResult.getFirstObject(async (err, asset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -181,7 +181,7 @@ export default function mediaLibraryTestCallback(abilityContext) { ...@@ -181,7 +181,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
media.getPublicDirectory(dir, async (err, res) => { media.getPublicDirectory(dir, async (err, res) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -219,7 +219,7 @@ export default function mediaLibraryTestCallback(abilityContext) { ...@@ -219,7 +219,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
media.getFileAssets(fetchOps, async (err, fetchFileResult) => { media.getFileAssets(fetchOps, async (err, fetchFileResult) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -243,7 +243,7 @@ export default function mediaLibraryTestCallback(abilityContext) { ...@@ -243,7 +243,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
media.createAsset(type, name, path, async (err, creatAsset) => { media.createAsset(type, name, path, async (err, creatAsset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
......
...@@ -69,7 +69,7 @@ export default function fileTestCallbackTest(abilityContext) { ...@@ -69,7 +69,7 @@ export default function fileTestCallbackTest(abilityContext) {
media.createAsset(type, displayName1, path, async (err, creatAsset1) => { media.createAsset(type, displayName1, path, async (err, creatAsset1) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -106,7 +106,7 @@ export default function fileTestCallbackTest(abilityContext) { ...@@ -106,7 +106,7 @@ export default function fileTestCallbackTest(abilityContext) {
media.createAsset(type, displayName, path, async (err, creatAsset) => { media.createAsset(type, displayName, path, async (err, creatAsset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -138,7 +138,7 @@ export default function fileTestCallbackTest(abilityContext) { ...@@ -138,7 +138,7 @@ export default function fileTestCallbackTest(abilityContext) {
asset.commitModify(async (err) => { asset.commitModify(async (err) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
......
...@@ -58,7 +58,7 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -58,7 +58,7 @@ export default function fileAssetCallback2Test(abilityContext) {
asset.commitModify(async (err) => { asset.commitModify(async (err) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -96,7 +96,7 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -96,7 +96,7 @@ export default function fileAssetCallback2Test(abilityContext) {
done(); done();
return; return;
} }
expect.assertFail(); expect().assertFail();
done(); done();
}); });
...@@ -184,13 +184,14 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -184,13 +184,14 @@ export default function fileAssetCallback2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_005' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_005'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '05', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '05', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 83; i++) { for (var i = 0; i < 83; i++) {
newName += "中"; val += "中";
} }
let val = newName + '.jpg' val += ".jpg";
await checkCommitModify(done, testNum, fetchOp, prop, val) await checkCommitModify(done, testNum, fetchOp, prop, val)
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_006 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_006
* @tc.name : commitModify * @tc.name : commitModify
...@@ -203,14 +204,52 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -203,14 +204,52 @@ export default function fileAssetCallback2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_006' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_006'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '06', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '06', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 251; i++) { for (var i = 0; i < 251; i++) {
newName += "a"; val += "a";
} }
let val = newName + '.jpg' val += ".jpg";
await checkCommitModify(done, testNum, fetchOp, prop, val) await checkCommitModify(done, testNum, fetchOp, prop, val)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_007
* @tc.name : commitModify
* @tc.desc : Modify title '中中....' (85)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_007", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_007";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyCb/", "07", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 85; i++) {
val += "中";
}
await checkCommitModify(done, testNum, fetchOp, prop, val);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_008
* @tc.name : commitModify
* @tc.desc : Modify title 'aaaaaaa....' (255)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_008", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_008";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyCb/", "08", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 255; i++) {
val += "a";
}
await checkCommitModify(done, testNum, fetchOp, prop, val);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_009 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_009
* @tc.name : commitModify * @tc.name : commitModify
...@@ -223,13 +262,14 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -223,13 +262,14 @@ export default function fileAssetCallback2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_009' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_009'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '09', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '09', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 84; i++) { for (var i = 0; i < 84; i++) {
newName += "中"; val += "中";
} }
let val = newName + '.jpg' val += ".jpg";
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val) await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val)
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_010 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_010
* @tc.name : commitModify * @tc.name : commitModify
...@@ -242,14 +282,52 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -242,14 +282,52 @@ export default function fileAssetCallback2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_010' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_010'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '010', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyCb/', '010', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 252; i++) { for (var i = 0; i < 252; i++) {
newName += "a"; val += "a";
} }
let val = newName + '.jpg' val += ".jpg";
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val) await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_011
* @tc.name : commitModify
* @tc.desc : Modify title '中中....' (86)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_011", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_011";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyCb/", "011", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 86; i++) {
val += "中";
}
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_012
* @tc.name : commitModify
* @tc.desc : Modify title 'aaaaaaa....' (256)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_012", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_CALLBACK_012";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyCb/", "012", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 256; i++) {
val += "a";
}
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_ISDIRECTORY_CALLBACK_001 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_ISDIRECTORY_CALLBACK_001
* @tc.name : isDirectory * @tc.name : isDirectory
...@@ -267,7 +345,7 @@ export default function fileAssetCallback2Test(abilityContext) { ...@@ -267,7 +345,7 @@ export default function fileAssetCallback2Test(abilityContext) {
asset.isDirectory((err, isDir) =>{ asset.isDirectory((err, isDir) =>{
if (err) { if (err) {
console.info(`${testNum} err : ${err}`); console.info(`${testNum} err : ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
......
...@@ -103,7 +103,7 @@ export default function fileAssetPromise2Test(abilityContext) { ...@@ -103,7 +103,7 @@ export default function fileAssetPromise2Test(abilityContext) {
asset[prop] = val; asset[prop] = val;
try { try {
await asset.commitModify(); await asset.commitModify();
expect.assertFail(); expect().assertFail();
done(); done();
} catch (error) { } catch (error) {
console.info(`${testNum} passed : ${error}`) console.info(`${testNum} passed : ${error}`)
...@@ -193,13 +193,14 @@ export default function fileAssetPromise2Test(abilityContext) { ...@@ -193,13 +193,14 @@ export default function fileAssetPromise2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_005' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_005'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '05', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '05', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 83; i++) { for (var i = 0; i < 83; i++) {
newName += "中"; val += "中";
} }
let val = newName + '.jpg' val += ".jpg";
await checkCommitModify(done, testNum, fetchOp, prop, val) await checkCommitModify(done, testNum, fetchOp, prop, val)
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_006 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_006
* @tc.name : commitModify * @tc.name : commitModify
...@@ -212,14 +213,52 @@ export default function fileAssetPromise2Test(abilityContext) { ...@@ -212,14 +213,52 @@ export default function fileAssetPromise2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_006' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_006'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '06', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '06', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 251; i++) { for (var i = 0; i < 251; i++) {
newName += "a"; val += "a";
}
val += ".jpg";
await checkCommitModify(done, testNum, fetchOp, prop, val)
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_007
* @tc.name : commitModify
* @tc.desc : Modify title '中中....' (85)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_007', 0, async function (done) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_007'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '07', IMAGE_TYPE);
let prop = 'title'
let val = "";
for (var i = 0; i < 85; i++) {
val += "中";
} }
let val = newName + '.jpg'
await checkCommitModify(done, testNum, fetchOp, prop, val) await checkCommitModify(done, testNum, fetchOp, prop, val)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_008
* @tc.name : title
* @tc.desc : Modify title 'aaaaaaa....' (255)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_008", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_008";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyPro/", "08", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 255; i++) {
val += "a";
}
await checkCommitModify(done, testNum, fetchOp, prop, val);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_009 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_009
* @tc.name : commitModify * @tc.name : commitModify
...@@ -232,13 +271,14 @@ export default function fileAssetPromise2Test(abilityContext) { ...@@ -232,13 +271,14 @@ export default function fileAssetPromise2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_009' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_009'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '09', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '09', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 84; i++) { for (var i = 0; i < 84; i++) {
newName += "中"; val += "中";
} }
let val = newName + '.jpg' val += ".jpg";
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val) await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val)
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_010 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_010
* @tc.name : commitModify * @tc.name : commitModify
...@@ -251,14 +291,51 @@ export default function fileAssetPromise2Test(abilityContext) { ...@@ -251,14 +291,51 @@ export default function fileAssetPromise2Test(abilityContext) {
let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_010' let testNum = 'SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_010'
let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '010', IMAGE_TYPE); let fetchOp = nameFetchOps(testNum, 'Pictures/ModifyPro/', '010', IMAGE_TYPE);
let prop = 'displayName' let prop = 'displayName'
let newName = ""; let val = "";
for (var i = 0; i < 252; i++) { for (var i = 0; i < 252; i++) {
newName += "a"; val += "a";
} }
let val = newName + '.jpg' val += ".jpg";
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val) await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_011
* @tc.name : commitModify
* @tc.desc : Modify title '中中....' (86)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_011", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_011";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyPro/", "011", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 86; i++) {
val += "中";
}
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_012
* @tc.name : commitModify
* @tc.desc : Modify title 'aaaaaaa....' (256)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_012", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_012";
let fetchOp = nameFetchOps(testNum, "Pictures/ModifyPro/", "012", IMAGE_TYPE);
let prop = "title";
let val = "";
for (var i = 0; i < 256; i++) {
val += "a";
}
await abnormalCheckCommitModify(done, testNum, fetchOp, prop, val);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_02_001 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILEASSET_COMMITMODIFY_PROMISE_02_001
......
...@@ -56,7 +56,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -56,7 +56,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
asset.open('rw', async (err, fd) => { asset.open('rw', async (err, fd) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -88,7 +88,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -88,7 +88,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
await asset.close(fd); await asset.close(fd);
await asset1.close(fd1); await asset1.close(fd1);
expect.assertFail(); expect().assertFail();
done(); done();
} }
} }
...@@ -104,7 +104,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -104,7 +104,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
asset.open('r', async (err, fd) => { asset.open('r', async (err, fd) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -115,7 +115,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -115,7 +115,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
expect(res.bytesRead).assertEqual(assetProps.bytesRead); expect(res.bytesRead).assertEqual(assetProps.bytesRead);
try { try {
await fileio.write(fd, buf); await fileio.write(fd, buf);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
await asset.close(fd); await asset.close(fd);
...@@ -125,7 +125,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -125,7 +125,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
} catch (error) { } catch (error) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
expect.assertFail(); expect().assertFail();
await asset.close(fd); await asset.close(fd);
done(); done();
} }
...@@ -146,7 +146,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -146,7 +146,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
asset.open('w', async (err, fd) => { asset.open('w', async (err, fd) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -160,7 +160,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -160,7 +160,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
let buf1 = new ArrayBuffer(4096); let buf1 = new ArrayBuffer(4096);
try { try {
await fileio.read(fd, buf1); await fileio.read(fd, buf1);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -191,7 +191,7 @@ export default function fileAssetTestCallbackTest(abilityContext) { ...@@ -191,7 +191,7 @@ export default function fileAssetTestCallbackTest(abilityContext) {
asset.close(fd, async (err) => { asset.close(fd, async (err) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
......
...@@ -80,7 +80,7 @@ export default function fileAssetTestPromiseTest(abilityContext) { ...@@ -80,7 +80,7 @@ export default function fileAssetTestPromiseTest(abilityContext) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
await asset.close(fd); await asset.close(fd);
await asset1.close(fd1); await asset1.close(fd1);
expect.assertFail(); expect().assertFail();
done(); done();
} }
} }
...@@ -101,7 +101,7 @@ export default function fileAssetTestPromiseTest(abilityContext) { ...@@ -101,7 +101,7 @@ export default function fileAssetTestPromiseTest(abilityContext) {
expect(res.bytesRead).assertEqual(assetProps.bytesRead); expect(res.bytesRead).assertEqual(assetProps.bytesRead);
try { try {
await fileio.write(fd, buf); await fileio.write(fd, buf);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
await asset.close(fd); await asset.close(fd);
...@@ -109,7 +109,7 @@ export default function fileAssetTestPromiseTest(abilityContext) { ...@@ -109,7 +109,7 @@ export default function fileAssetTestPromiseTest(abilityContext) {
} }
} catch (error) { } catch (error) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
expect.assertFail(); expect().assertFail();
await asset.close(fd); await asset.close(fd);
done(); done();
} }
...@@ -138,7 +138,7 @@ export default function fileAssetTestPromiseTest(abilityContext) { ...@@ -138,7 +138,7 @@ export default function fileAssetTestPromiseTest(abilityContext) {
let buf1 = new ArrayBuffer(4096); let buf1 = new ArrayBuffer(4096);
try { try {
await fileio.read(fd, buf1); await fileio.read(fd, buf1);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
......
...@@ -75,7 +75,7 @@ export default function getFileAssetsCallbackTest(abilityContext) { ...@@ -75,7 +75,7 @@ export default function getFileAssetsCallbackTest(abilityContext) {
fetchAssetResult.getFirstObject(async (err, asset) => { fetchAssetResult.getFirstObject(async (err, asset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
fetchAssetResult.close(); fetchAssetResult.close();
done(); done();
return; return;
...@@ -106,7 +106,7 @@ export default function getFileAssetsCallbackTest(abilityContext) { ...@@ -106,7 +106,7 @@ export default function getFileAssetsCallbackTest(abilityContext) {
fetchAssetResult.getNextObject(async (err, asset) => { fetchAssetResult.getNextObject(async (err, asset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
fetchAssetResult.close(); fetchAssetResult.close();
done(); done();
return; return;
...@@ -136,7 +136,7 @@ export default function getFileAssetsCallbackTest(abilityContext) { ...@@ -136,7 +136,7 @@ export default function getFileAssetsCallbackTest(abilityContext) {
fetchAssetResult.getLastObject(async (err, asset) => { fetchAssetResult.getLastObject(async (err, asset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
fetchAssetResult.close(); fetchAssetResult.close();
done(); done();
return; return;
...@@ -166,7 +166,7 @@ export default function getFileAssetsCallbackTest(abilityContext) { ...@@ -166,7 +166,7 @@ export default function getFileAssetsCallbackTest(abilityContext) {
fetchAssetResult.getPositionObject(pos, async (err, asset) => { fetchAssetResult.getPositionObject(pos, async (err, asset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
fetchAssetResult.close(); fetchAssetResult.close();
done(); done();
return; return;
...@@ -263,7 +263,7 @@ export default function getFileAssetsCallbackTest(abilityContext) { ...@@ -263,7 +263,7 @@ export default function getFileAssetsCallbackTest(abilityContext) {
fetchAssetResult.getFirstObject((err, asset) => { fetchAssetResult.getFirstObject((err, asset) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
fetchAssetResult.close(); fetchAssetResult.close();
done(); done();
return; return;
......
...@@ -67,7 +67,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) { ...@@ -67,7 +67,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
await asset.commitModify(async (err) => { await asset.commitModify(async (err) => {
if (err) { if (err) {
console.info(`${testNum} err : ${err}`) console.info(`${testNum} err : ${err}`)
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
......
...@@ -60,7 +60,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -60,7 +60,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
asset.open('r', async (err, fd) => { asset.open('r', async (err, fd) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -71,7 +71,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -71,7 +71,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
expect(res.bytesRead).assertEqual(assetProps.bytesRead); expect(res.bytesRead).assertEqual(assetProps.bytesRead);
try { try {
await fileio.write(fd, buf); await fileio.write(fd, buf);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
await asset.close(fd); await asset.close(fd);
...@@ -80,7 +80,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -80,7 +80,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
}); });
} catch (error) { } catch (error) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
expect.assertFail(); expect().assertFail();
await asset.close(fd); await asset.close(fd);
done(); done();
} }
...@@ -104,7 +104,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -104,7 +104,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
asset.open('w', async (err, fd) => { asset.open('w', async (err, fd) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -118,7 +118,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -118,7 +118,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
let buf1 = new ArrayBuffer(4096); let buf1 = new ArrayBuffer(4096);
try { try {
await fileio.read(fd, buf1); await fileio.read(fd, buf1);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
...@@ -149,7 +149,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -149,7 +149,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
asset.open('rw', async (err, fd) => { asset.open('rw', async (err, fd) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
...@@ -175,7 +175,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -175,7 +175,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
await asset.close(fd); await asset.close(fd);
await asset1.close(fd1); await asset1.close(fd1);
expect.assertFail(); expect().assertFail();
done(); done();
} }
} }
...@@ -198,7 +198,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) { ...@@ -198,7 +198,7 @@ export default function fileAssetOpenCallbackTest(abilityContext) {
asset.close(fd, async (err) => { asset.close(fd, async (err) => {
if (err) { if (err) {
console.info(`${testNum} :: err: ${err}`); console.info(`${testNum} :: err: ${err}`);
expect.assertFail(); expect().assertFail();
done(); done();
return; return;
} }
......
...@@ -66,7 +66,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) { ...@@ -66,7 +66,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) {
expect(res.bytesRead).assertEqual(assetProps.bytesRead); expect(res.bytesRead).assertEqual(assetProps.bytesRead);
try { try {
await fileio.write(fd, buf); await fileio.write(fd, buf);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
await asset.close(fd); await asset.close(fd);
...@@ -74,7 +74,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) { ...@@ -74,7 +74,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) {
} }
} catch (error) { } catch (error) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
expect.assertFail(); expect().assertFail();
await asset.close(fd); await asset.close(fd);
done(); done();
} }
...@@ -107,7 +107,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) { ...@@ -107,7 +107,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) {
let buf1 = new ArrayBuffer(4096); let buf1 = new ArrayBuffer(4096);
try { try {
await fileio.read(fd, buf1); await fileio.read(fd, buf1);
expect.assertFail(); expect().assertFail();
} catch (error) { } catch (error) {
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -158,7 +158,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) { ...@@ -158,7 +158,7 @@ export default function fileAssetOpenPromiseTest(abilityContext) {
console.info(`${testNum} :: error: ${error}`); console.info(`${testNum} :: error: ${error}`);
await asset.close(fd); await asset.close(fd);
await asset1.close(fd1); await asset1.close(fd1);
expect.assertFail(); expect().assertFail();
done(); done();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册