From 626827e488785705e0d1b92254638141fafa10a1 Mon Sep 17 00:00:00 2001 From: 18721213663 Date: Tue, 28 Mar 2023 11:48:15 +0800 Subject: [PATCH] bugfix_fs_write_checkfd Signed-off-by: 18721213663 --- .../src/main/js/test/members/read.test.js | 7 +++---- .../src/main/js/test/members/write.test.js | 14 ++++++-------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/storage/storagefileiov9jstest/src/main/js/test/members/read.test.js b/storage/storagefileiov9jstest/src/main/js/test/members/read.test.js index ffae4076b..54a206db0 100644 --- a/storage/storagefileiov9jstest/src/main/js/test/members/read.test.js +++ b/storage/storagefileiov9jstest/src/main/js/test/members/read.test.js @@ -751,14 +751,13 @@ export default function fileIORead() { try { fileIO.read(-1, new ArrayBuffer(4096), (err) => { if(err) { - console.log('fileIO_test_read_async_013 error: {message: ' + err.message + ', code: ' + err.code + '}'); - expect(err.code == 13900020 && err.message == 'Invalid argument').assertTrue(); - done(); + expect(false).assertTrue(); } }); } catch (e) { 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(); } }); diff --git a/storage/storagefileiov9jstest/src/main/js/test/members/write.test.js b/storage/storagefileiov9jstest/src/main/js/test/members/write.test.js index c2b36e1e5..a75a36b2d 100644 --- a/storage/storagefileiov9jstest/src/main/js/test/members/write.test.js +++ b/storage/storagefileiov9jstest/src/main/js/test/members/write.test.js @@ -238,7 +238,7 @@ export default function fileIOWrite() { expect(false).assertTrue(); } catch (e) { 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() { } catch (e) { fileIO.unlinkSync(fpath); 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(); } }); @@ -871,15 +871,13 @@ export default function fileIOWrite() { try { fileIO.write(-1, FILE_CONTENT, (err) => { - if(err) { - 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(); - } + expect(false).assertTrue(); }); } catch (e) { + fileIO.unlinkSync(fpath); 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(); } }); -- GitLab