diff --git a/storage/storagefileioerrorjstest/src/main/js/default/test/FileIOError.test.js b/storage/storagefileioerrorjstest/src/main/js/default/test/FileIOError.test.js index 061978cca2c56bd7c0875b4d4c0aaf81a8ae6e40..cbc7162de9ae4a31f4ea78f236520652183ec01e 100644 --- a/storage/storagefileioerrorjstest/src/main/js/default/test/FileIOError.test.js +++ b/storage/storagefileioerrorjstest/src/main/js/default/test/FileIOError.test.js @@ -130,7 +130,8 @@ describe('FileIOError', function () { } catch (err) { console.info('fileio_test_error_004 has failed for ' + err); - expect(isInclude(err.message, 'Symbolic link loop') || isInclude(err.message, 'Too many symbolic links encountered')).assertTrue(); + expect(isInclude(err.message, 'Symbolic link loop') || + isInclude(err.message, 'Too many symbolic links encountered')).assertTrue(); fileio.unlinkSync(fpath); fileio.unlinkSync(ffpath); done(); diff --git a/storage/storagefileiojstest/src/main/js/default/test/FileIO.test.js b/storage/storagefileiojstest/src/main/js/default/test/FileIO.test.js index 5809b55d8a22e9a6fae77466f928920dc9c31d5b..0c1849d547efaa497e7735438e39616ce7c96f65 100644 --- a/storage/storagefileiojstest/src/main/js/default/test/FileIO.test.js +++ b/storage/storagefileiojstest/src/main/js/default/test/FileIO.test.js @@ -492,11 +492,10 @@ describe('fileIOTest', function () { expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); try { fileio.openSync(fpath, 0o40002, 0o700); - expect(null).assertFail(); + fileio.unlinkSync(fpath); }catch (err) { console.info('fileio_test_open_019 has failed for ' + err); - expect(err.message == "Not a directory").assertTrue(); - fileio.unlinkSync(fpath); + expect(null).assertFail(); } }); @@ -523,17 +522,15 @@ describe('fileIOTest', function () { /** * @tc.number SUB_STORAGE_FileIO_OpenSync_2200 * @tc.name fileio_test_open_022 - * @tc.desc Function of API, flags=0o200002. + * @tc.desc Function of API, flags=0o200000. */ it('fileio_test_open_022', 0, async function () { - let fpath = await nextFileName('fileio_test_open_022'); - expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); + let dpath = await nextFileName('fileio_test_open_022') + 'd'; + fileio.mkdirSync(dpath); try { - let fd = fileio.openSync(fpath, 0o200002); - expect(fd !== null).assertTrue(); - fileio.closeSync(fd); - fileio.unlinkSync(fpath); - } + fileio.openSync(dpath, 0o200000, 0o666); + fileio.rmdirSync(dpath); + } catch (err) { console.info('fileio_test_open_022 has failed for ' + err); expect(null).assertFail();