提交 626827e4 编写于 作者: 1 18721213663

bugfix_fs_write_checkfd

Signed-off-by: N18721213663 <zhuhongtao12@huawei.com>
上级 2212b4e2
...@@ -751,14 +751,13 @@ export default function fileIORead() { ...@@ -751,14 +751,13 @@ export default function fileIORead() {
try { try {
fileIO.read(-1, new ArrayBuffer(4096), (err) => { fileIO.read(-1, new ArrayBuffer(4096), (err) => {
if(err) { if(err) {
console.log('fileIO_test_read_async_013 error: {message: ' + err.message + ', code: ' + err.code + '}'); expect(false).assertTrue();
expect(err.code == 13900020 && err.message == 'Invalid argument').assertTrue();
done();
} }
}); });
} catch (e) { } catch (e) {
console.log('fileIO_test_read_async_013 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_read_async_013 has failed for ' + e.message + ', code: ' + e.code);
expect(false).assertTrue(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
} }
}); });
......
...@@ -238,7 +238,7 @@ export default function fileIOWrite() { ...@@ -238,7 +238,7 @@ export default function fileIOWrite() {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_write_sync_007 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_write_sync_007 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900008 && e.message == 'Bad file descriptor').assertTrue(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
} }
}); });
...@@ -850,7 +850,7 @@ export default function fileIOWrite() { ...@@ -850,7 +850,7 @@ export default function fileIOWrite() {
} catch (e) { } catch (e) {
fileIO.unlinkSync(fpath); fileIO.unlinkSync(fpath);
console.log('fileIO_test_write_async_016 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_write_async_016 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900008 && e.message == 'Bad file descriptor').assertTrue(); expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done(); done();
} }
}); });
...@@ -871,15 +871,13 @@ export default function fileIOWrite() { ...@@ -871,15 +871,13 @@ export default function fileIOWrite() {
try { try {
fileIO.write(-1, FILE_CONTENT, (err) => { fileIO.write(-1, FILE_CONTENT, (err) => {
if(err) { expect(false).assertTrue();
fileIO.unlinkSync(fpath);
console.log('fileIO_test_open_async_020 error: {message: ' + err.message + ', code: ' + err.code + '}');
expect(err.code == 13900008 && err.message == 'Bad file descriptor').assertTrue();
done();
}
}); });
} catch (e) { } catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_write_async_017 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_write_async_017 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900020 && e.message == 'Invalid argument').assertTrue();
done();
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册