提交 befeeda4 编写于 作者: O openharmony_ci 提交者: Gitee

!326 FILEIO部分接口实现与定义不符,此处予以修正

Merge pull request !326 from 猫科龙/master
......@@ -561,7 +561,7 @@ describe('fileIOTest', function () {
try {
expect(fileio.chmodSync(fpath, 0o660)).assertNull()
expect(fileio.Stat.statSync(fpath).mode & 0o777).assertEqual(0o660)
expect(fileio.statSync(fpath).mode & 0o777).assertEqual(0o660)
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
console.log("fileio_test_chmod_sync_000 has failed for " + e)
......@@ -661,7 +661,7 @@ describe('fileIOTest', function () {
try {
expect(fileio.truncateSync(fpath)).assertNull()
expect(fileio.Stat.statSync(fpath).size).assertEqual(0)
expect(fileio.statSync(fpath).size).assertEqual(0)
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
console.log("fileio_test_truncate_sync_000 has failed for " + e)
......@@ -761,7 +761,7 @@ describe('fileIOTest', function () {
try {
let fd = fileio.openSync(fpath, 0o2)
expect(fileio.fchmodSync(fd, 0o660)).assertNull()
expect(fileio.Stat.statSync(fpath).mode & 0o777).assertEqual(0o660)
expect(fileio.statSync(fpath).mode & 0o777).assertEqual(0o660)
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
console.log("fileio_test_fchmod_sync_000 has failed for " + e)
......@@ -794,7 +794,7 @@ describe('fileIOTest', function () {
try {
let fd = fileio.openSync(fpath, 0o2)
expect(fileio.ftruncateSync(fd)).assertNull()
expect(fileio.Stat.statSync(fpath).size).assertEqual(0)
expect(fileio.statSync(fpath).size).assertEqual(0)
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
console.log("fileio_test_ftruncate_sync_000 has failed for " + e)
......
......@@ -29,7 +29,7 @@ describe('fileIOTestDir', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
expect(dd.closeSync()).assertNull()
expect(fileio.rmdirSync(dpath)).assertNull()
......@@ -46,7 +46,7 @@ describe('fileIOTestDir', function () {
*/
it('fileio_test_dir_open_close_sync_001', 0, function () {
try {
fileio.Dir.opendirSync()
fileio.opendirSync()
expect(null).assertFail()
} catch (e) {
}
......@@ -61,7 +61,7 @@ describe('fileIOTestDir', function () {
let dpath = nextFileName('fileio_test_dir_read_sync_000') + 'd'
try {
fileio.Dir.opendirSync(dpath)
fileio.opendirSync(dpath)
expect(null).assertFail()
} catch (e) {
}
......@@ -79,7 +79,7 @@ describe('fileIOTestDir', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
expect(dd.readSync() != null).assertTrue()
expect(dd.closeSync()).assertNull()
......@@ -105,7 +105,7 @@ describe('fileIOTestDir', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
expect(dd.readSync(-1) != null).assertTrue()
expect(null).assertFail()
......
......@@ -31,7 +31,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -57,7 +57,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -84,7 +84,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -109,7 +109,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -136,7 +136,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -161,7 +161,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -188,7 +188,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -213,7 +213,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -240,7 +240,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -265,7 +265,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -292,7 +292,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -317,7 +317,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -344,7 +344,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -369,7 +369,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
let dd = fileio.Dir.opendirSync(dpath)
let dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......@@ -396,7 +396,7 @@ describe('fileIOTestDirent', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
dd = fileio.Dir.opendirSync(dpath)
dd = fileio.opendirSync(dpath)
expect(dd !== null).assertTrue()
let dirent = dd.readSync()
expect(dirent !== null).assertTrue()
......
......@@ -65,7 +65,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat !== null).assertTrue()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -83,7 +83,7 @@ describe('fileIOTestStat', function () {
let fpath = nextFileName('fileio_test_stat_stat_sync_001')
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(null).assertFail()
} catch (e) {
}
......@@ -99,7 +99,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.dev).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -118,7 +118,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.ino).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -137,7 +137,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.mode).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -156,7 +156,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.nlink).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -175,7 +175,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.uid).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -194,7 +194,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.gid).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -213,7 +213,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.rdev).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -232,7 +232,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.size).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -251,7 +251,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.blocks).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -270,7 +270,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.atime).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -289,7 +289,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.mtime).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -308,7 +308,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.ctime).assertInstanceOf('Number')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -327,7 +327,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isBlockDevice()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -346,7 +346,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isBlockDevice()).assertFalse()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -365,7 +365,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isBlockDevice(-1)).assertFalse()
expect(null).assertFail()
} catch (e) {
......@@ -383,7 +383,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isCharacterDevice()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -402,7 +402,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isCharacterDevice()).assertFalse()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -421,7 +421,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isCharacterDevice(-1)).assertFalse()
expect(null).assertFail()
} catch (e) {
......@@ -439,7 +439,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isDirectory()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -458,7 +458,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isDirectory()).assertFalse()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -477,7 +477,7 @@ describe('fileIOTestStat', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
let stat = fileio.Stat.statSync(dpath)
let stat = fileio.statSync(dpath)
expect(stat.isDirectory()).assertTrue()
expect(fileio.rmdirSync(dpath)).assertNull()
} catch (e) {
......@@ -496,7 +496,7 @@ describe('fileIOTestStat', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
let stat = fileio.Stat.statSync(dpath)
let stat = fileio.statSync(dpath)
expect(stat.isDirectory(-1)).assertTrue()
expect(null).assertFail()
} catch (e) {
......@@ -514,7 +514,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isFIFO()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -533,7 +533,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isFIFO()).assertFalse()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -552,7 +552,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isFIFO(-1)).assertFalse()
expect(null).assertFail()
} catch (e) {
......@@ -570,7 +570,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertInstanceOf('Boolean')
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isFile()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -589,7 +589,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertInstanceOf('Boolean')
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isFile()).assertTrue()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -608,7 +608,7 @@ describe('fileIOTestStat', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
let stat = fileio.Stat.statSync(dpath)
let stat = fileio.statSync(dpath)
expect(stat.isFile()).assertFalse()
expect(fileio.rmdirSync(dpath)).assertNull()
} catch (e) {
......@@ -627,7 +627,7 @@ describe('fileIOTestStat', function () {
try {
expect(fileio.mkdirSync(dpath)).assertNull()
let stat = fileio.Stat.statSync(dpath)
let stat = fileio.statSync(dpath)
expect(stat.isFile(-1)).assertFalse()
expect(null).assertFail()
} catch (e) {
......@@ -645,7 +645,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isSocket()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -664,7 +664,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isSocket()).assertFalse()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -683,7 +683,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isSocket(-1)).assertFalse()
expect(null).assertFail()
} catch (e) {
......@@ -701,7 +701,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isSymbolicLink()).assertInstanceOf('Boolean')
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -720,7 +720,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isSymbolicLink()).assertFalse()
expect(fileio.unlinkSync(fpath)).assertNull()
} catch (e) {
......@@ -739,7 +739,7 @@ describe('fileIOTestStat', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let stat = fileio.Stat.statSync(fpath)
let stat = fileio.statSync(fpath)
expect(stat.isSymbolicLink(-1)).assertFalse()
expect(null).assertFail()
} catch (e) {
......
......@@ -29,7 +29,7 @@ describe('fileIOTestStream', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
var ss = fileio.Stream.createStreamSync(fpath, "r+")
var ss = fileio.createStreamSync(fpath, "r+")
expect(ss !== null).assertTrue()
expect(ss.closeSync()).assertNull()
expect(fileio.unlinkSync(fpath)).assertNull()
......@@ -48,7 +48,7 @@ describe('fileIOTestStream', function () {
let fpath = nextFileName('fileio_test_stream_create_stream_sync_001')
try {
fileio.Stream.createStreamSync(fpath, "r+")
fileio.createStreamSync(fpath, "r+")
expect(null).assertFail()
} catch (e) {
}
......@@ -64,7 +64,7 @@ describe('fileIOTestStream', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
fileio.Stream.createStreamSync(fpath, "ohos")
fileio.createStreamSync(fpath, "ohos")
expect(null).assertFail()
} catch (e) {
expect(fileio.unlinkSync(fpath)).assertNull()
......@@ -82,7 +82,7 @@ describe('fileIOTestStream', function () {
try {
var fd = fileio.openSync(fpath, 0o2)
let ss = fileio.Stream.fdopenStreamSync(fd, "r+")
let ss = fileio.fdopenStreamSync(fd, "r+")
expect(ss !== null).assertTrue()
expect(ss.closeSync()).assertNull()
expect(fileio.unlinkSync(fpath)).assertNull()
......@@ -99,7 +99,7 @@ describe('fileIOTestStream', function () {
*/
it('fileio_test_stream_fdopen_stream_sync_001', 0, function () {
try {
let ss = fileio.Stream.fdopenStreamSync(-1, "r+")
let ss = fileio.fdopenStreamSync(-1, "r+")
expect(null).assertFail()
} catch (e) {
}
......@@ -115,7 +115,7 @@ describe('fileIOTestStream', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let ss = fileio.Stream.createStreamSync(fpath, "r+")
let ss = fileio.createStreamSync(fpath, "r+")
expect(ss !== null).assertTrue()
let len = ss.readSync(new ArrayBuffer(4096))
expect(len).assertEqual(FILE_CONTENT.length)
......@@ -137,7 +137,7 @@ describe('fileIOTestStream', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let ss = fileio.Stream.createStreamSync(fpath, "r+")
let ss = fileio.createStreamSync(fpath, "r+")
expect(ss !== null).assertTrue()
expect(ss.writeSync(FILE_CONTENT)).assertEqual(FILE_CONTENT.length)
expect(ss.closeSync()).assertNull()
......@@ -158,7 +158,7 @@ describe('fileIOTestStream', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue()
try {
let ss = fileio.Stream.createStreamSync(fpath, "r+")
let ss = fileio.createStreamSync(fpath, "r+")
expect(ss !== null).assertTrue()
expect(ss.writeSync(FILE_CONTENT)).assertEqual(FILE_CONTENT.length)
expect(ss.flushSync()).assertNull()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册