提交 e29c98bb 编写于 作者: Z zhangxingxia

update fileio xts

Signed-off-by: Nzhangxingxia <zhangxingxia1@huawei.com>
上级 680f847e
...@@ -1385,19 +1385,18 @@ describe('fileIOTestStream', function () { ...@@ -1385,19 +1385,18 @@ describe('fileIOTestStream', function () {
let fpath = await nextFileName('fileio_test_stream_read_sync_005'); let fpath = await nextFileName('fileio_test_stream_read_sync_005');
let text = '0123456789abcdefg'; let text = '0123456789abcdefg';
expect(prepareFile(fpath, text)).assertTrue(); expect(prepareFile(fpath, text)).assertTrue();
let ss = fileio.createStreamSync(fpath, 'r+');
expect(ss !== null).assertTrue();
try { try {
var ss = fileio.createStreamSync(fpath, 'r+'); ss.readSync(new ArrayBuffer(4096), {
expect(ss !== null).assertTrue();
let len = ss.readSync(new ArrayBuffer(4096), {
position: -1 position: -1
}); });
expect(len == text.length).assertTrue();
ss.closeSync();
fileio.unlinkSync(fpath);
} }
catch (e) { catch (e) {
console.log('---fileio_test_stream_read_sync_005 has failed for ' + e); console.info('fileio_test_stream_read_sync_005 has failed for ' + e);
expect(null).assertFail(); expect(e.message == "option.position shall be positive number").assertTrue();
ss.closeSync();
fileio.unlinkSync(fpath);
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册