未验证 提交 1438474b 编写于 作者: O openharmony_ci 提交者: Gitee

!2905 update prepareFile

Merge pull request !2905 from raoxian/cherry-pick-1648455421
......@@ -217,7 +217,7 @@ describe('FileError', function () {
*/
it('File_test_error_007', 0, async function (done) {
let fpath = fileName('file_test_error_007');
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.rmdir({
uri: 'internal://app/file_test_error_007',
recursive: true,
......@@ -282,7 +282,7 @@ describe('FileError', function () {
let dpath = fileName('file_test_error_009') + 'd';
let fpath = dpath + '/file_test_error_009';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.rmdir({
uri: 'internal://app/file_test_error_009d',
recursive: true,
......@@ -311,7 +311,7 @@ describe('FileError', function () {
let dpath = fileName('file_test_error_010') + 'd';
let fpath = dpath + '/file_test_error_010';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.rmdir({
uri: 'internal://app/file_test_error_010d',
recursive: false,
......
......@@ -216,7 +216,7 @@ describe('FileIOError', function () {
let dpath = fileName('fileio_test_error_009d');
let fpath = dpath + '/fileio_test_error_009f';
fileio.mkdirSync(dpath);
prepareFile(fpath, 'hello');
expect(prepareFile(fpath, 'hello')).assertTrue();
try {
expect(fileio.rmdirSync(dpath) !== null).assertTrue();
expect(null).assertFail();
......@@ -235,7 +235,7 @@ describe('FileIOError', function () {
*/
it('FileIo_test_error_010', 0, function () {
let fpath = fileName('fileio_test_error_010f');
prepareFile(fpath, 'hello');
expect(prepareFile(fpath, 'hello')).assertTrue();
try {
expect(fileio.rmdirSync(fpath) !== null).assertTrue();
expect(null).assertFail();
......@@ -283,7 +283,7 @@ describe('FileIOError', function () {
*/
it('FileIo_test_error_012', 0, function () {
let fpath = nextFileName('FileIo_test_error_012');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o102);
expect(null).assertFail();
......@@ -317,7 +317,7 @@ describe('FileIOError', function () {
*/
it('FileIo_test_error_014', 0, function () {
let fpath = nextFileName('FileIo_test_error_014');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o202);
expect(null).assertFail();
......@@ -335,7 +335,7 @@ describe('FileIOError', function () {
*/
it('FileIo_test_error_015', 0, function () {
let fpath = nextFileName('FileIo_test_error_015');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o302);
expect(null).assertFail();
......@@ -353,7 +353,7 @@ describe('FileIOError', function () {
*/
it('FileIo_test_error_016', 0, function () {
let fpath = nextFileName('FileIo_test_error_016');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o100002);
expect(null).assertFail();
......@@ -406,7 +406,7 @@ describe('FileIOError', function () {
it('FileIo_test_error_019', 0, function () {
let fpath = nextFileName('FileIo_test_error_019');
let txt = 'h'
prepareFile(fpath, txt);
expect(prepareFile(fpath, txt)).assertTrue();
try {
fileio.openSync(fpath, 0o400002);
expect(null).assertFail();
......@@ -425,7 +425,7 @@ describe('FileIOError', function () {
it('FileIo_test_error_020', 0, function () {
let fpath = nextFileName('FileIo_test_error_020');
let txt = randomString(5000);
prepareFile(fpath, txt);
expect(prepareFile(fpath, txt)).assertTrue();
try {
fileio.openSync(fpath, 0o400002);
expect(null).assertFail();
......@@ -459,7 +459,7 @@ describe('FileIOError', function () {
*/
it('FileIo_test_error_022', 0, function () {
let fpath = nextFileName('FileIo_test_error_022');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let fpathTarget = fpath + 'f1';
try {
fileio.copyFileSync(fpath, fpathTarget, 1);
......
......@@ -482,7 +482,7 @@ describe('fileVirtualPath', function () {
*/
it('File_Move_013', 0, async function (done) {
let srcFpath = fileName('File_Move_013');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.move({
srcUri: 'internal://app/../files/File_Move_013',
dstUri: 'internal://app/../../ohos.acts.distributeddatamgr.distributedfile/File_Move_013',
......@@ -511,7 +511,7 @@ describe('fileVirtualPath', function () {
*/
it('File_Copy_013', 0, async function (done) {
let srcFpath = fileName('File_Copy_013');
expect(prepareFile(srcFpath, 'test') !== null).assertTrue();
expect(prepareFile(srcFpath, 'test')).assertTrue();
file.copy({
srcUri: 'internal://app/../files/File_Copy_013',
dstUri: 'internal://app/../../ohos.acts.distributeddatamgr.distributedfile/File_Copy_013',
......
......@@ -60,7 +60,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_000', 0, async function () {
let fpath = await nextFileName('fileio_test_open_000');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o202);
expect(fd !== null).assertTrue();
......@@ -80,7 +80,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_001', 0, async function () {
let fpath = await nextFileName('fileio_test_open_001');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o100, 0o01);
expect(fd !== null).assertTrue();
......@@ -100,7 +100,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_002', 0, async function () {
let fpath = await nextFileName('fileio_test_open_002');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
expect(fd !== null).assertTrue();
......@@ -120,7 +120,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_003', 0, async function () {
let fpath = await nextFileName('fileio_test_open_003');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o100, 0o004);
expect(fd !== null).assertTrue();
......@@ -144,7 +144,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_004', 0, async function () {
let fpath = await nextFileName('fileio_test_open_004');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o101, 0o002);
expect(fd !== null).assertTrue();
......@@ -166,7 +166,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_005', 0, async function () {
let fpath = await nextFileName('fileio_test_open_005');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o102, 0o001);
expect(fd !== null).assertTrue();
......@@ -196,7 +196,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_006', 0, async function () {
let fpath = await nextFileName('fileio_test_open_006');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o200, 0o700);
expect(null).assertFail();
......@@ -287,7 +287,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_010', 0, async function () {
let fpath = await nextFileName('fileio_test_open_010');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o402);
expect(fd !== null).assertTrue();
......@@ -317,7 +317,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_011', 0, async function () {
let fpath = await nextFileName('fileio_test_open_011');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o1000);
expect(fd !== null).assertTrue();
......@@ -341,7 +341,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_012', 0, async function () {
let fpath = await nextFileName('fileio_test_open_012');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o1001);
expect(fd !== null).assertTrue();
......@@ -363,7 +363,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_013', 0, async function () {
let fpath = await nextFileName('fileio_test_open_013');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o2002);
expect(fd !== null).assertTrue();
......@@ -393,7 +393,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_014', 0, async function (done) {
let fpath = await nextFileName('fileio_test_open_014');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o4002);
expect(fd !== null).assertTrue();
......@@ -417,7 +417,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_015', 0, async function () {
let fpath = await nextFileName('fileio_test_open_015');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o20002);
expect(fd !== null).assertTrue();
......@@ -437,7 +437,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_016', 0, async function () {
let fpath = await nextFileName('fileio_test_open_016');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o10002);
expect(fd !== null).assertTrue();
......@@ -457,7 +457,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_017', 0, async function () {
let fpath = await nextFileName('fileio_test_open_017');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o4010002);
expect(fd !== null).assertTrue();
......@@ -477,7 +477,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_018', 0, async function () {
let fpath = await nextFileName('fileio_test_open_018');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o100002);
expect(fd !== null).assertTrue();
......@@ -497,7 +497,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_019', 0, async function () {
let fpath = await nextFileName('fileio_test_open_019');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
fileio.openSync(fpath, 0o40002, 0o700);
expect(null).assertFail();
......@@ -515,7 +515,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_021', 0, async function () {
let fpath = await nextFileName('fileio_test_open_021');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o2000002);
expect(fd !== null).assertTrue();
......@@ -535,7 +535,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_022', 0, async function () {
let fpath = await nextFileName('fileio_test_open_022');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o200002);
expect(fd !== null).assertTrue();
......@@ -555,7 +555,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_023', 0, async function () {
let fpath = await nextFileName('fileio_test_open_023');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o400002);
expect(fd !== null).assertTrue();
......@@ -575,7 +575,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_024', 0, async function () {
let fpath = await nextFileName('fileio_test_open_024');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o1000002, 0o700);
expect(fd !== null).assertTrue();
......@@ -595,7 +595,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_025', 0, async function () {
let fpath = await nextFileName('fileio_test_open_025');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o10000002);
expect(fd !== null).assertTrue();
......@@ -615,7 +615,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_026', 0, async function () {
let fpath = await nextFileName('fileio_test_open_026');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o700);
expect(fd !== null).assertTrue();
......@@ -635,7 +635,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_027', 0, async function () {
let fpath = await nextFileName('fileio_test_open_027');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o400);
expect(fd !== null).assertTrue();
......@@ -662,7 +662,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_028', 0, async function () {
let fpath = await nextFileName('fileio_test_open_028');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o200);
expect(fd !== null).assertTrue();
......@@ -689,7 +689,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_029', 0, async function () {
let fpath = await nextFileName('fileio_test_open_029');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o100);
expect(fd !== null).assertTrue();
......@@ -709,7 +709,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_030', 0, async function () {
let fpath = await nextFileName('fileio_test_open_030');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o070);
expect(fd !== null).assertTrue();
......@@ -739,7 +739,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_031', 0, async function () {
let fpath = await nextFileName('fileio_test_open_031');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o040);
expect(fd !== null).assertTrue();
......@@ -766,7 +766,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_032', 0, async function () {
let fpath = await nextFileName('fileio_test_open_032');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o020);
expect(fd !== null).assertTrue();
......@@ -793,7 +793,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_033', 0, async function () {
let fpath = await nextFileName('fileio_test_open_033');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o010);
expect(fd !== null).assertTrue();
......@@ -813,7 +813,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_034', 0, async function () {
let fpath = await nextFileName('fileio_test_open_034');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o007);
expect(fd !== null).assertTrue();
......@@ -843,7 +843,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_035', 0, async function () {
let fpath = await nextFileName('fileio_test_open_035');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o004);
expect(fd !== null).assertTrue();
......@@ -870,7 +870,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_036', 0, async function () {
let fpath = await nextFileName('fileio_test_open_036');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o002);
expect(fd !== null).assertTrue();
......@@ -897,7 +897,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_037', 0, async function () {
let fpath = await nextFileName('fileio_test_open_037');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o002, 0o001);
expect(fileio.closeSync(fd) !== null).assertTrue();
......@@ -933,7 +933,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_sync_001', 0, async function () {
let fpath = await nextFileName('fileio_test_open_sync_001');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o200);
expect(fd !== null).assertTrue();
......@@ -953,7 +953,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_sync_002', 0, async function () {
let fpath = await nextFileName('fileio_test_open_sync_002');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o201);
expect(fd !== null).assertTrue();
......@@ -973,7 +973,7 @@ describe('fileIOTest', function () {
*/
it('fileio_test_open_sync_003', 0, async function () {
let fpath = await nextFileName('fileio_test_open_sync_003');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath, 0o202);
expect(fd !== null).assertTrue();
......
......@@ -706,7 +706,7 @@ describe('fileio_stat_fstat', function () {
*/
it('fileio_fstat_is_file_000', 0, async function () {
let fpath = await nextFileName('fileio_fstat_is_file_000');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
......@@ -732,7 +732,7 @@ describe('fileio_stat_fstat', function () {
*/
it('fileio_fstat_is_file_001', 0, async function () {
let fpath = await nextFileName('fileio_fstat_is_file_001');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
......@@ -1551,7 +1551,7 @@ describe('fileio_stat_fstat', function () {
*/
it('fileio_fstat_async_is_file_000', 0, async function (done) {
let fpath = await nextFileName('fileio_fstat_async_is_file_000');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
......@@ -1577,7 +1577,7 @@ describe('fileio_stat_fstat', function () {
*/
it('fileio_fstat_async_is_file_001', 0, async function (done) {
let fpath = await nextFileName('fileio_fstat_async_is_file_001');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let fd = fileio.openSync(fpath);
......
......@@ -656,7 +656,7 @@ describe('fileio_lstat', function () {
*/
it('fileio_lstat_is_file_000', 0, async function () {
let fpath = await nextFileName('fileio_lstat_is_file_000');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = fileio.lstatSync(fpath);
......@@ -680,7 +680,7 @@ describe('fileio_lstat', function () {
*/
it('fileio_lstat_is_file_001', 0, async function () {
let fpath = await nextFileName('fileio_lstat_is_file_001');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = fileio.lstatSync(fpath);
......@@ -1470,7 +1470,7 @@ describe('fileio_lstat', function () {
*/
it('fileio_lstat_async_is_file_000', 0, async function (done) {
let fpath = await nextFileName('fileio_lstat_async_is_file_000');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = await fileio.lstat(fpath);
......@@ -1494,7 +1494,7 @@ describe('fileio_lstat', function () {
*/
it('fileio_lstat_async_is_file_001', 0, async function (done) {
let fpath = await nextFileName('fileio_lstat_async_is_file_001');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = await fileio.lstat(fpath);
......
......@@ -672,7 +672,7 @@ describe('fileio_stat', function () {
*/
it('fileio_stat_sync_is_file_000', 0, async function () {
let fpath = await nextFileName('fileio_stat_sync_is_file_000');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = fileio.statSync(fpath);
......@@ -696,7 +696,7 @@ describe('fileio_stat', function () {
*/
it('fileio_stat_sync_is_file_001', 0, async function () {
let fpath = await nextFileName('fileio_stat_sync_is_file_001');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = fileio.statSync(fpath);
......@@ -1463,7 +1463,7 @@ describe('fileio_stat', function () {
*/
it('fileio_stat_async_is_file_000', 0, async function (done) {
let fpath = await nextFileName('fileio_stat_async_is_file_000');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = await fileio.stat(fpath);
......@@ -1487,7 +1487,7 @@ describe('fileio_stat', function () {
*/
it('fileio_stat_async_is_file_001', 0, async function (done) {
let fpath = await nextFileName('fileio_stat_async_is_file_001');
expect(isBoolean(prepareFile(fpath, FILE_CONTENT))).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let stat = await fileio.stat(fpath);
......
......@@ -46,7 +46,7 @@ describe('fileTest', function () {
*/
it('File_Delete_001', 0, async function (done) {
let fpath = await fileName('File_Delete_001');
prepareFile(fpath, 'hello');
expect(prepareFile(fpath, 'hello')).assertTrue();
file.delete({
uri: 'internal://cache/../files/File_Delete_001',
success: function () {
......@@ -121,7 +121,7 @@ describe('fileTest', function () {
let dpath = await fileName('File_Delete_004');
let fpath = dpath + '/File_Delete_004';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.delete({
uri: 'internal://app/File_Delete_004',
success: function () {
......@@ -1424,7 +1424,7 @@ describe('fileTest', function () {
*/
it('File_read_array_buffer_004', 0, async function (done) {
let fpath = await fileName('File_read_array_buffer_004');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.readArrayBuffer({
uri: fpath,
position: 100,
......@@ -1447,7 +1447,7 @@ describe('fileTest', function () {
*/
it('File_read_array_buffer_005', 0, async function (done) {
let fpath = await fileName('File_read_array_buffer_005');
prepareFile(fpath, FILE_CONTENT);
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.readArrayBuffer({
uri: fpath,
length: -1,
......@@ -2368,7 +2368,7 @@ describe('fileTest', function () {
for (let i = 0; i < typeArray.length; i++) {
let srcFpath = await fileName('File_Move_002') + typeArray[i];
let dstFpath = await cacheFileName('File_Move_002') + typeArray[i];
expect(prepareEmptyFile(srcFpath) !== null).assertTrue();
expect(prepareEmptyFile(srcFpath)).assertTrue();
file.move({
srcUri: 'internal://cache/../files/File_Move_002' + typeArray[i],
dstUri: 'internal://cache/../files/cache/File_Move_002' + typeArray[i],
......@@ -2391,7 +2391,7 @@ describe('fileTest', function () {
*/
it('File_Move_003', 0, async function (done) {
let srcFpath = await fileName('File_Move_003');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
let dstFpath = await cacheFileName('File_Move_003');
let srcUri = 'internal://cache/../files/File_Move_003';
let dstUri = 'internal://app/cache/File_Move_003';
......@@ -2416,7 +2416,7 @@ describe('fileTest', function () {
*/
it('File_Move_004', 0, async function (done) {
let srcFpath = await fileName('File_Move_004');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.move({
srcUri: 'internal://app/File_Move_004',
dstUri: null,
......@@ -2462,7 +2462,7 @@ describe('fileTest', function () {
*/
it('File_Move_006', 0, async function (done) {
let dstUri = await fileName('File_Move_006');
expect(prepareFile(dstUri, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(dstUri, FILE_CONTENT)).assertTrue();
file.move({
srcUri: 'internal://app/File_Move',
dstUri: 'internal://app/File_Move_006',
......@@ -2559,7 +2559,7 @@ describe('fileTest', function () {
*/
it('File_Move_009', 0, async function (done) {
let srcFpath = await fileName('File_Move_009');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.move({
srcUri: 'internal://app/File_Move_009',
dstUri: 'internal://app/File_Move_009',
......@@ -2583,8 +2583,8 @@ describe('fileTest', function () {
it('File_Move_010', 0, async function (done) {
let srcFpath = await fileName('File_Move_010');
let dstFpath = await cacheFileName('File_Move_010');
expect(prepareFile(srcFpath, 'aaa') !== null).assertTrue();
expect(prepareFile(dstFpath, 'bbb') !== null).assertTrue();
expect(prepareFile(srcFpath, 'aaa')).assertTrue();
expect(prepareFile(dstFpath, 'bbb')).assertTrue();
file.move({
srcUri: 'internal://app/File_Move_010',
dstUri: 'internal://app/cache/File_Move_010',
......@@ -2607,7 +2607,7 @@ describe('fileTest', function () {
*/
it('File_Move_011', 0, async function (done) {
let srcFpath = await fileName('File_Move_011');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.move({
srcUri: 'internal://cache/../files/File_Move_011',
dstUri: 'internal://cache/File_Move_011',
......@@ -2629,7 +2629,7 @@ describe('fileTest', function () {
*/
it('File_Move_012', 0, async function (done) {
let srcFpath = await fileName('File_Move_012');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.move({
srcUri: 'internal://app/../files/File_Move_012',
dstUri: 'internal://app/notdir/File_Move_012',
......@@ -2653,7 +2653,7 @@ describe('fileTest', function () {
it('File_Move_014', 0, async function (done) {
let srcFpath = await fileName('File_Move_014');
let dstFpath = await cacheFileName('File_Move_014');
expect(prepareFile(srcFpath, 'test') !== null).assertTrue();
expect(prepareFile(srcFpath, 'test')).assertTrue();
let dstUri = 'internal://cache/File_Move_014';
file.move({
srcUri: 'internal://cache/../files/File_Move_014',
......@@ -2677,7 +2677,7 @@ describe('fileTest', function () {
it('File_Copy_001', 0, async function (done) {
let srcFpath = await fileName('File_Copy_001');
let dstFpath = await cacheFileName('File_Copy_001');
expect(prepareFile(srcFpath, 'test.') !== null).assertTrue();
expect(prepareFile(srcFpath, 'test.')).assertTrue();
file.copy({
srcUri: 'internal://cache/../files/File_Copy_001',
dstUri: 'internal://cache/../files/cache/File_Copy_001',
......@@ -2715,7 +2715,7 @@ describe('fileTest', function () {
for (let i = 0; i < typeArray.length; i++) {
let srcFpath = await fileName('File_Copy_002') + typeArray[i];
let dstFpath = await cacheFileName('File_Copy_002') + typeArray[i];
expect(prepareEmptyFile(srcFpath) !== null).assertTrue();
expect(prepareEmptyFile(srcFpath)).assertTrue();
file.copy({
srcUri: 'internal://cache/../files/File_Copy_002' + typeArray[i],
dstUri: 'internal://cache/../files/cache/File_Copy_002' + typeArray[i],
......@@ -2740,7 +2740,7 @@ describe('fileTest', function () {
*/
it('File_Copy_003', 0, async function (done) {
let srcFpath = await fileName('File_Copy_003');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
let dstFpath = await cacheFileName('File_Copy_003');
file.copy({
srcUri: 'internal://cache/../files/File_Copy_003',
......@@ -2777,7 +2777,7 @@ describe('fileTest', function () {
*/
it('File_Copy_004', 0, async function (done) {
let srcFpath = await fileName('File_Copy_004');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.copy({
srcUri: 'internal://app/File_Copy_004',
dstUri: null,
......@@ -2939,7 +2939,7 @@ describe('fileTest', function () {
*/
it('File_Copy_009', 0, async function (done) {
let srcFpath = await fileName('File_Copy_009');
expect(prepareFile(srcFpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(srcFpath, FILE_CONTENT)).assertTrue();
file.copy({
srcUri: 'internal://app/File_Copy_009',
dstUri: 'internal://app/File_Copy_009',
......@@ -2964,8 +2964,8 @@ describe('fileTest', function () {
it('File_Copy_010', 0, async function (done) {
let srcFpath = await fileName('File_Copy_010');
let dstFpath = await cacheFileName('File_Copy_010');
expect(prepareFile(srcFpath, 'aaa') !== null).assertTrue();
expect(prepareFile(dstFpath, 'bbb') !== null).assertTrue();
expect(prepareFile(srcFpath, 'aaa')).assertTrue();
expect(prepareFile(dstFpath, 'bbb')).assertTrue();
file.copy({
srcUri: 'internal://app/File_Copy_010',
dstUri: 'internal://app/cache/File_Copy_010',
......@@ -2991,7 +2991,7 @@ describe('fileTest', function () {
*/
it('File_Copy_011', 0, async function (done) {
let srcFpath = await fileName('File_Copy_011');
expect(prepareFile(srcFpath, 'test.') !== null).assertTrue();
expect(prepareFile(srcFpath, 'test.')).assertTrue();
file.copy({
srcUri: 'internal://cache/../files/File_Copy_011',
dstUri: 'internal://cache/File_Copy_011',
......@@ -3024,7 +3024,7 @@ describe('fileTest', function () {
*/
it('File_Copy_012', 0, async function (done) {
let srcFpath = await fileName('File_Copy_012');
expect(prepareFile(srcFpath, 'test') !== null).assertTrue();
expect(prepareFile(srcFpath, 'test')).assertTrue();
file.copy({
srcUri: 'internal://app/../files/File_Copy_012',
dstUri: 'internal://app/notdir/File_Move_012',
......@@ -3050,7 +3050,7 @@ describe('fileTest', function () {
it('File_Copy_014', 0, async function (done) {
let srcFpath = await fileName('File_Copy_014');
let dstFpath = await cacheFileName('File_Copy_014');
expect(prepareFile(srcFpath, 'test') !== null).assertTrue();
expect(prepareFile(srcFpath, 'test')).assertTrue();
let dstUri = 'internal://cache/File_Copy_014';
file.copy({
srcUri: 'internal://cache/../files/File_Copy_014',
......@@ -3077,7 +3077,7 @@ describe('fileTest', function () {
let ddpath = dpath + '/File_List_001_1d';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_001d',
success: function (data) {
......@@ -3105,7 +3105,7 @@ describe('fileTest', function () {
let ddpath = dpath + '/File_List_002_1d';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_002d',
success: function (data) {
......@@ -3133,7 +3133,7 @@ describe('fileTest', function () {
let ddpath = dpath + '/File_List_003_1d';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_003d',
success: function (data) {
......@@ -3180,7 +3180,7 @@ describe('fileTest', function () {
let ddpath = dpath + '/File_List_004_1d';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_004d',
success: function (data) {
......@@ -3205,7 +3205,7 @@ describe('fileTest', function () {
let ddpath = dpath + '/File_List_005_1d';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_005d',
success: function (data) {
......@@ -3247,7 +3247,7 @@ describe('fileTest', function () {
*/
it('File_List_007', 0, async function (done) {
let fpath = await fileName('File_List_007');
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_007',
success: function (data) {
......@@ -3326,9 +3326,9 @@ describe('fileTest', function () {
try {
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fffpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT)).assertTrue();
expect(prepareFile(fffpath, FILE_CONTENT)).assertTrue();
}
catch (e) {
console.log('File_List_010 has failed for ' + e);
......@@ -3363,7 +3363,7 @@ describe('fileTest', function () {
let ddpath = dpath + '/File_List_011_1d';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.list({
uri: 'internal://cache/../files/File_List_011d',
success: function (data) {
......@@ -3406,7 +3406,7 @@ describe('fileTest', function () {
*/
it('File_Get_001', 0, async function (done) {
let fpath = await fileName('File_Get_001');
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/File_Get_001',
recursive: true,
......@@ -3429,7 +3429,7 @@ describe('fileTest', function () {
*/
it('File_Get_002', 0, async function (done) {
let fpath = await fileName('File_Get_002');
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/File_Get_002',
recursive: false,
......@@ -3457,7 +3457,7 @@ describe('fileTest', function () {
*/
it('File_Get_003', 0, async function (done) {
let fpath = await fileName('File_Get_003');
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/File_Get_003',
success: function (data) {
......@@ -3490,8 +3490,8 @@ describe('fileTest', function () {
let ffpath = ddpath + '/File_Get_004ff'
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/File_Get_004d',
recursive: true,
......@@ -3528,8 +3528,8 @@ describe('fileTest', function () {
let ffpath = ddpath + '/File_Get_005ff';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/File_Get_005d',
recursive: false,
......@@ -3566,8 +3566,8 @@ describe('fileTest', function () {
let ffpath = ddpath + '/File_Get_006ff';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/File_Get_006d',
success: function (data) {
......@@ -3766,8 +3766,8 @@ describe('fileTest', function () {
let ffpath = ddpath + '/File_Get_013ff';
expect(fileio.mkdirSync(dpath) !== null).assertTrue();
expect(fileio.mkdirSync(ddpath) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT) !== null).assertTrue();
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
expect(prepareFile(ffpath, FILE_CONTENT)).assertTrue();
file.get({
uri: 'internal://cache/../files/../files/File_Get_013d',
recursive: true,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册