未验证 提交 692f5cb0 编写于 作者: O openharmony_ci 提交者: Gitee

!8218 fileapi 增加read、write、close接口入参检查,原有错误码调整

Merge pull request !8218 from zhuhongtao666/bugfix1
...@@ -156,7 +156,7 @@ describe('fileIO_fs_close', function () { ...@@ -156,7 +156,7 @@ describe('fileIO_fs_close', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_close_sync_005 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_close_sync_005 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();
} }
}); });
...@@ -367,7 +367,7 @@ describe('fileIO_fs_close', function () { ...@@ -367,7 +367,7 @@ describe('fileIO_fs_close', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_close_async_007 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_close_async_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();
done(); done();
} }
}); });
......
...@@ -297,7 +297,7 @@ export default function fileIORead() { ...@@ -297,7 +297,7 @@ export default function fileIORead() {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_read_sync_009 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_read_sync_009 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();
} }
}); });
...@@ -732,7 +732,7 @@ export default function fileIORead() { ...@@ -732,7 +732,7 @@ export default function fileIORead() {
expect(false).assertTrue(); expect(false).assertTrue();
} catch (e) { } catch (e) {
console.log('fileIO_test_read_async_012 has failed for ' + e.message + ', code: ' + e.code); console.log('fileIO_test_read_async_012 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();
} }
}); });
...@@ -752,7 +752,7 @@ export default function fileIORead() { ...@@ -752,7 +752,7 @@ export default function fileIORead() {
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 + '}'); console.log('fileIO_test_read_async_013 error: {message: ' + err.message + ', code: ' + err.code + '}');
expect(err.code == 13900008 && err.message == 'Bad file descriptor').assertTrue(); expect(err.code == 13900020 && err.message == 'Invalid argument').assertTrue();
done(); done();
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册