提交 d976b9cd 编写于 作者: S Storage sandboxing

修改缺陷

Signed-off-by: NStorage sandboxing <raoxian@huawei.com>
上级 28ec77cf
......@@ -1064,6 +1064,7 @@ describe('fileIOTest', function () {
expect(null).assertFail();
}
catch (e) {
console.log('fileio_test_open_sync_007 has failed for ' + e);
}
});
......@@ -1104,6 +1105,7 @@ describe('fileIOTest', function () {
expect(null).assertFail();
}
catch (e) {
console.log('fileio_test_open_sync_009 has failed for ' + e);
}
});
......@@ -1119,6 +1121,7 @@ describe('fileIOTest', function () {
expect(null).assertFail();
}
catch (e) {
console.log('fileio_test_open_sync_010 has failed for ' + e);
}
});
......@@ -2311,6 +2314,7 @@ describe('fileIOTest', function () {
expect(null).assertFail();
}
catch (e) {
console.log('fileio_test_copy_file_sync_008 has failed for ' + e);
}
});
......@@ -2329,7 +2333,7 @@ describe('fileIOTest', function () {
}
catch (e) {
fileio.unlinkSync(fpath);
console.log('fileio_test_open_sync_008 has failed for ' + e);
console.log('fileio_test_copy_file_sync_009 has failed for ' + e);
}
});
......@@ -3492,6 +3496,7 @@ describe('fileIOTest', function () {
expect(null).assertFail();
}
catch (e) {
console.log('fileio_test_fstat_sync_001 has failed for ' + e);
}
});
......@@ -3506,6 +3511,7 @@ describe('fileIOTest', function () {
expect(null).assertFail();
}
catch (e) {
console.log('fileio_test_fstat_sync_002 has failed for ' + e);
}
});
......
......@@ -60,6 +60,7 @@ describe('fileio_stream', function () {
fileio.createStreamSync(fpath, 'r+');
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_stream_create_stream_sync_001 has failed for ' + e);
}
});
......
......@@ -60,6 +60,7 @@ describe('fileio_stream', function () {
let ss = fileio.fdopenStreamSync(-1, 'r+');
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_stream_fdopen_stream_sync_001 has failed for ' + e);
}
})
......
......@@ -129,6 +129,7 @@ describe('fileio_access', function () {
fileio.accessSync(fpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_access_sync_004' + e);
}
});
......
......@@ -34,6 +34,7 @@ describe('fileio_close', function () {
fileio.closeSync();
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_close_sync_000 has failed for ' + e);
}
})
......@@ -51,6 +52,7 @@ describe('fileio_close', function () {
fileio.closeSync(-1);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_close_sync_001 has failed for ' + e);
}
})
})
......@@ -61,6 +61,7 @@ describe('fileio_copyfile', function () {
fileio.copyFileSync(fpath, fpathTarget);
expect(null).assertFail();
} catch (e) {
console.log('fileio_copy_file_sync_001 has failed for ' + e);
}
});
......@@ -78,6 +79,7 @@ describe('fileio_copyfile', function () {
fileio.copyFileSync();
expect(null).assertFail();
} catch (e) {
console.log('fileio_copy_file_sync_002 has failed for ' + e);
}
});
......
......@@ -127,6 +127,7 @@ describe('fileio_fchmod', function () {
expect(fileio.fchmodSync(-1, 0o660) == null).assertTrue();
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_fchmod_sync_001 has failed for ' + e);
}
});
......
......@@ -117,6 +117,7 @@ describe('fileio_fdatasync', async function () {
await fileio.fdatasync(fd);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_fdatasync_async_003 has failed for ' + e);
}
});
});
......@@ -64,6 +64,7 @@ describe('fileio_FdOpenStream', async function () {
let fp = fileio.fdopenStreamSync(fd, mode);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_fdopenstream_sync_001 has failed for ' + e);
}
})
......
......@@ -61,6 +61,7 @@ describe('fileio_stat_fstat', function () {
fileio.fstatSync(invalidFD);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_stat_fstat_sync_001 has failed for ' + e);
}
});
......
......@@ -58,6 +58,7 @@ describe('fileio_stat_fsync', function () {
fileio.fsyncSync(-1);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_fsync_sync_001 has failed for ' + e);
}
});
......
......@@ -61,6 +61,7 @@ describe('fileio_lstat', function () {
fileio.lstatSync(fpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_lstat_sync_001 has failed for ' + e);
}
});
......
......@@ -52,6 +52,7 @@ describe('fileio_mkdir_rmdir', function () {
expect(fileio.mkdirSync('/') == null).assertTrue();
expect(null).assertFail();
} catch (e) {
console.log('fileio_mkdir_sync_rmdir_sync_001 has failed for ' + e);
}
});
......@@ -69,6 +70,7 @@ describe('fileio_mkdir_rmdir', function () {
expect(fileio.mkdirSync(12) == null).assertTrue();
expect(null).assertFail();
} catch (e) {
console.log('fileio_mkdir_sync_rmdir_sync_002 has failed for ' + e);
}
});
......
......@@ -34,6 +34,7 @@ describe('fileio_mkdtemp', function () {
let res = fileio.mkdtempSync(dpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_mkdtemp_sync_000 has failed for ' + e);
}
});
......
......@@ -33,7 +33,9 @@ describe('fileio_open', function () {
try {
fileio.openSync('/', 0o102, 0o666);
expect(null).assertFail();
} catch (e) {}
} catch (e) {
console.log('fileio_test_open_sync_000 has failed for ' + e);
}
});
/**
......
......@@ -81,6 +81,7 @@ describe('fileio_open_close', function () {
fileio.openSync('/', 0o102, 0o666);
expect(null).assertFail();
} catch (e) {
console.log('fileio_open_sync_000 has failed for ' + e);
}
});
......@@ -100,6 +101,7 @@ describe('fileio_open_close', function () {
fileio.openSync(fpath, 0o102);
expect(null).assertFail();
} catch (e) {
console.log('fileio_open_sync_001 has failed for ' + e);
}
});
......@@ -117,6 +119,7 @@ describe('fileio_open_close', function () {
fileio.closeSync();
expect(null).assertFail();
} catch (e) {
console.log('fileio_close_sync_000 has failed for ' + e);
}
});
......@@ -134,6 +137,7 @@ describe('fileio_open_close', function () {
fileio.closeSync(-1);
expect(null).assertFail();
} catch (e) {
console.log('fileio_close_sync_001 has failed for ' + e);
}
});
});
\ No newline at end of file
......@@ -57,6 +57,7 @@ describe('fileio_dir_opendir_close', function () {
fileio.opendirSync(dpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_dir_open_close_sync_001 has failed for ' + e);
}
});
......
......@@ -205,6 +205,7 @@ describe('fileio_read', function () {
fileio.readSync(-1, new ArrayBuffer(4096));
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_read_sync_006 has failed for ' + e);
}
});
......@@ -458,10 +459,10 @@ describe('fileio_read', function () {
});
expect(null).assertFail();
} catch (e) {
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
});
/**
......
......@@ -107,6 +107,7 @@ describe('fileio_readtext', function () {
fileio.readTextSync();
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_readtext_sync_003 has failed for ' + e);
}
});
......@@ -126,6 +127,7 @@ describe('fileio_readtext', function () {
fileio.readTextSync(fpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_readtext_sync_004 has failed for ' + e);
}
});
......
......@@ -61,6 +61,7 @@ describe('fileio_stat', function () {
fileio.statSync(fpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_stat_sync_001 has failed for ' + e);
}
});
......
......@@ -39,6 +39,7 @@ describe('fileio_symlink', function () {
fileio.unlinkSync(fpath + 'aaaa');
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_symlink_sync_000 has failed for ' + e);
}
});
......
......@@ -147,7 +147,9 @@ describe('fileio_truncate', function () {
try {
fileio.truncateSync(fpath);
expect(null).assertFail();
} catch (e) {}
} catch (e) {
console.log('fileio_test_truncate_sync_001 has failed for ' + e);
}
});
/**
......@@ -163,6 +165,8 @@ describe('fileio_truncate', function () {
try {
fileio.truncateSync();
expect(null).assertFail();
} catch (e) {}
} catch (e) {
console.log('fileio_test_truncate_sync_002 has failed for ' + e);
}
});
});
......@@ -34,6 +34,7 @@ describe('fileio_unlink', function () {
fileio.unlinkSync();
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_unlink_sync_000 has failed for ' + e);
}
});
......@@ -53,6 +54,7 @@ describe('fileio_unlink', function () {
fileio.unlinkSync(fpath);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_unlink_sync_001 has failed for ' + e);
}
});
......
......@@ -229,6 +229,7 @@ describe('fileio_write', function () {
fileio.writeSync();
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_write_sync_007 has failed for ' + e);
}
});
......@@ -246,6 +247,7 @@ describe('fileio_write', function () {
fileio.writeSync(-1, FILE_CONTENT);
expect(null).assertFail();
} catch (e) {
console.log('fileio_test_write_sync_008 has failed for ' + e);
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册