diff --git a/storage/storagefileiojstest/src/main/js/test/Common.js b/storage/storagefileiojstest/src/main/js/test/Common.js index ab53cac8ac295a330dfd702774e50d0e29894358..aed7ef789cd0e63d909110deeb2ab45a8b5fabcc 100644 --- a/storage/storagefileiojstest/src/main/js/test/Common.js +++ b/storage/storagefileiojstest/src/main/js/test/Common.js @@ -112,6 +112,10 @@ function isIntNum(val) { return typeof val === 'number' && val % 1 === 0; } +function isBigInt(val) { + return typeof val === 'bigint'; +} + function isString(str) { return (typeof str == 'string') && str.constructor == String; } @@ -127,6 +131,7 @@ function isInclude(error, message) { export { fileio, isIntNum, + isBigInt, isString, isBoolean, isInclude, diff --git a/storage/storagefileiojstest/src/main/js/test/FileIOStat.test.js b/storage/storagefileiojstest/src/main/js/test/FileIOStat.test.js index e35d4772f9ffb48c5b62ad4b99a9c6911ac55389..acf278d91b5eb1a7ceae1b4fb0ffb8cece187b89 100644 --- a/storage/storagefileiojstest/src/main/js/test/FileIOStat.test.js +++ b/storage/storagefileiojstest/src/main/js/test/FileIOStat.test.js @@ -130,16 +130,16 @@ describe('fileIOTestStat', function () { /** * @tc.number SUB_STORAGE_FileIO_Stat_ino_0000 * @tc.name fileio_test_stat_ino_000 - * @tc.desc Function of API. Get inode number. + * @tc.desc Function of API. Get inode bigint. */ it('fileio_test_stat_ino_000', 0, async function () { let fpath = await nextFileName('fileio_test_stat_ino_000'); expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); try { let stat = fileio.statSync(fpath); - expect(typeof(stat.ino) == 'number').assertTrue(); + expect(typeof(stat.ino) == 'bigint').assertTrue(); fileio.unlinkSync(fpath); - } + } catch (e) { console.log('fileio_test_stat_ino_000 has failed for ' + e); expect(null).assertFail(); diff --git a/storage/storagefileiojstest/src/main/js/test/module_fileio/members/fstat.test.js b/storage/storagefileiojstest/src/main/js/test/module_fileio/members/fstat.test.js index 1179f9c5cc0e67499373a0df05a19b054e19d73d..ef601a783e20e462c59113c4b5828ba9e541f00c 100644 --- a/storage/storagefileiojstest/src/main/js/test/module_fileio/members/fstat.test.js +++ b/storage/storagefileiojstest/src/main/js/test/module_fileio/members/fstat.test.js @@ -14,7 +14,7 @@ */ import { - fileio, FILE_CONTENT, prepareFile, nextFileName, isIntNum, isBoolean, + fileio, FILE_CONTENT, prepareFile, nextFileName, isIntNum, isBigInt, isBoolean, describe, it, expect, } from '../../Common'; @@ -107,7 +107,7 @@ describe('fileio_fstat', function () { try { let fd = fileio.openSync(fpath); let stat = fileio.fstatSync(fd); - expect(isIntNum(stat.ino)).assertTrue(); + expect(isBigInt(stat.ino)).assertTrue(); expect(fileio.closeSync(fd) == null).assertTrue(); expect(fileio.unlinkSync(fpath) == null).assertTrue(); } catch (e) { @@ -1043,7 +1043,7 @@ describe('fileio_fstat', function () { try { let fd = fileio.openSync(fpath); let stat = await fileio.fstat(fd); - expect(isIntNum(stat.ino)).assertTrue(); + expect(isBigInt(stat.ino)).assertTrue(); expect(fileio.closeSync(fd) == null).assertTrue(); expect(fileio.unlinkSync(fpath) == null).assertTrue(); done(); diff --git a/storage/storagefileiojstest/src/main/js/test/module_fileio/members/lstat.test.js b/storage/storagefileiojstest/src/main/js/test/module_fileio/members/lstat.test.js index e0a70d53eeb013335d44e36a76026b083f2ec8ec..4524ac9d9a1099e72f8e9af77ead1c30289141d1 100644 --- a/storage/storagefileiojstest/src/main/js/test/module_fileio/members/lstat.test.js +++ b/storage/storagefileiojstest/src/main/js/test/module_fileio/members/lstat.test.js @@ -14,7 +14,7 @@ */ import { - fileio, FILE_CONTENT, prepareFile, nextFileName, isIntNum, isBoolean, + fileio, FILE_CONTENT, prepareFile, nextFileName, isIntNum, isBigInt, isBoolean, describe, it, expect, } from '../../Common'; @@ -103,7 +103,7 @@ describe('fileio_lstat', function () { expect(prepareFile(fpath, FILE_CONTENT)).assertTrue(); try { let stat = fileio.lstatSync(fpath); - expect(isIntNum(stat.ino)).assertTrue(); + expect(isBigInt(stat.ino)).assertTrue(); expect(fileio.unlinkSync(fpath) == null).assertTrue(); } catch (e) { console.log('fileio_lstat_ino_000 has failed for ' + e); @@ -992,7 +992,7 @@ describe('fileio_lstat', function () { try { let stat = await fileio.lstat(fpath); - expect(isIntNum(stat.ino)).assertTrue(); + expect(isBigInt(stat.ino)).assertTrue(); expect(fileio.unlinkSync(fpath) == null).assertTrue(); done(); } catch (e) { diff --git a/storage/storagefileiojstest/src/main/js/test/module_fileio/members/stat.test.js b/storage/storagefileiojstest/src/main/js/test/module_fileio/members/stat.test.js index 8ea44de21596939e64243f574db7656dbf5b7d4f..2e7c739c5e8b14e216b1d3d589cb53ac21864ca3 100644 --- a/storage/storagefileiojstest/src/main/js/test/module_fileio/members/stat.test.js +++ b/storage/storagefileiojstest/src/main/js/test/module_fileio/members/stat.test.js @@ -14,7 +14,7 @@ */ import { - fileio, FILE_CONTENT, prepareFile, nextFileName, isIntNum, isBoolean, + fileio, FILE_CONTENT, prepareFile, nextFileName, isIntNum, isBigInt, isBoolean, describe, it, expect, } from '../../Common'; @@ -106,7 +106,7 @@ describe('fileio_stat', function () { try { let stat = fileio.statSync(fpath); - expect(isIntNum(stat.ino)).assertTrue(); + expect(isBigInt(stat.ino)).assertTrue(); expect(fileio.unlinkSync(fpath) == null).assertTrue(); } catch (e) { console.log('fileio_stat_sync_ino_000 has failed for ' + e); @@ -985,7 +985,7 @@ describe('fileio_stat', function () { try { let stat = await fileio.stat(fpath); - expect(isIntNum(stat.ino)).assertTrue(); + expect(isBigInt(stat.ino)).assertTrue(); expect(fileio.unlinkSync(fpath) == null).assertTrue(); done(); } catch (e) {