Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ebd5553e
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ebd5553e
编写于
1月 14, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 14, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7064 Modified XTS for stat. Added XTS for fdatasync and fsync interfaces of mod_fs.
Merge pull request !7064 from futurezhou/stat
上级
9a62d09c
bf532ca1
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1401 addition
and
508 deletion
+1401
-508
storage/storagefileiov9jstest/src/main/js/test/members/fdatasync.test.js
...fileiov9jstest/src/main/js/test/members/fdatasync.test.js
+295
-0
storage/storagefileiov9jstest/src/main/js/test/members/fsync.test.js
...ragefileiov9jstest/src/main/js/test/members/fsync.test.js
+295
-0
storage/storagefileiov9jstest/src/main/js/test/members/stat.test.js
...oragefileiov9jstest/src/main/js/test/members/stat.test.js
+811
-508
未找到文件。
storage/storagefileiov9jstest/src/main/js/test/members/fdatasync.test.js
0 → 100644
浏览文件 @
ebd5553e
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
fileio
,
fileIO
,
FILE_CONTENT
,
prepareFile
,
nextFileName
,
describe
,
it
,
expect
,
}
from
'
../Common
'
;
export
default
function
fileIOFdatasync
()
{
describe
(
'
fileIO_fs_fdatasync
'
,
async
function
()
{
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_SYNC_0000
* @tc.name fileIO_test_fdatasync_sync_000
* @tc.desc Test fdatasyncSync() interfaces.
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_sync_000
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fdatasync_sync_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
fileIO
.
fdatasyncSync
(
file
.
fd
);
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_sync_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_SYNC_0010
* @tc.name fileIO_test_fdatasync_sync_001
* @tc.desc Test fdatasyncSync() interfaces. Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_sync_001
'
,
0
,
async
function
()
{
try
{
fileIO
.
fdatasyncSync
(
-
1
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_sync_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900008
&&
e
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_SYNC_0020
* @tc.name fileIO_test_fdatasync_sync_002
* @tc.desc Test fdatasyncSync() interfaces. Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_sync_002
'
,
0
,
async
function
()
{
try
{
fileIO
.
fdatasyncSync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_sync_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0000
* @tc.name fileIO_test_fdatasync_async_000
* @tc.desc Test fdatasync() interfaces. Callback.
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_000
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fdatasync_async_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
fileIO
.
fdatasync
(
file
.
fd
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_000 error package:
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
}
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0010
* @tc.name fileIO_test_fdatasync_async_001
* @tc.desc Test fdatasync() interfaces. Promise.then().catch().
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_001
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fdatasync_async_001
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
fileio
.
fdatasync
(
file
.
fd
).
then
(()
=>
{
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
'
fileIO_test_fdatasync_async_001 error package:
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0020
* @tc.name fileIO_test_fdatasync_async_002
* @tc.desc Test fdatasync() interfaces. await Promise.
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_002
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fdatasync_async_002
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
await
fileio
.
fdatasync
(
file
.
fd
);
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0030
* @tc.name fileIO_test_fdatasync_async_003
* @tc.desc Test fdatasync() interfaces. await Promise.
* Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_003
'
,
0
,
async
function
(
done
)
{
try
{
await
fileIO
.
fdatasync
(
-
1
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_003 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900008
&&
e
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0040
* @tc.name fileIO_test_fdatasync_async_004
* @tc.desc Test fdatasync() interfaces. Callback.
* Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_004
'
,
0
,
async
function
(
done
)
{
try
{
fileIO
.
fdatasync
(
-
1
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_004 error package: {
'
+
err
.
message
+
'
, code:
'
+
err
.
code
+
'
}
'
);
expect
(
err
.
code
==
13900008
&&
err
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
done
();
}
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_004 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0050
* @tc.name fileIO_test_fdatasync_async_005
* @tc.desc Test fdatasync() interfaces. Promise.then().catch()
* Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_005
'
,
0
,
async
function
(
done
)
{
try
{
fileIO
.
fdatasync
(
-
1
).
then
(()
=>
{
expect
(
false
).
assertTrue
();
}).
catch
((
err
)
=>
{
console
.
log
(
'
fileIO_test_fdatasync_async_005 error package: {
'
+
err
.
message
+
'
, code:
'
+
err
.
code
+
'
}
'
);
expect
(
err
.
code
==
13900008
&&
err
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_005 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0060
* @tc.name fileIO_test_fdatasync_async_006
* @tc.desc Test fdatasync() interfaces. Promise.
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_006
'
,
0
,
async
function
(
done
)
{
try
{
await
fileIO
.
fdatasync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_006 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FDATASYNC_ASYNC_0070
* @tc.name fileIO_test_fdatasync_async_007
* @tc.desc Test fdatasync() interfaces. Callback.
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fdatasync_async_007
'
,
0
,
async
function
(
done
)
{
try
{
fileIO
.
fdatasync
(()
=>
{
expect
(
false
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fdatasync_async_007 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
done
();
}
});
})
}
storage/storagefileiov9jstest/src/main/js/test/members/fsync.test.js
0 → 100644
浏览文件 @
ebd5553e
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
fileio
,
fileIO
,
FILE_CONTENT
,
prepareFile
,
nextFileName
,
describe
,
it
,
expect
,
}
from
'
../Common
'
;
export
default
function
fileIOFsync
()
{
describe
(
'
fileIO_fs_fsync
'
,
function
()
{
/**
* @tc.number SUB_DF_FILEIO_FSYNC_SYNC_0000
* @tc.name fileIO_test_fsync_sync_000
* @tc.desc Test fsyncSync() interface.
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_sync_000
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fsync_sync_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
fileIO
.
fsyncSync
(
file
.
fd
);
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_sync_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_SYNC_0010
* @tc.name fileIO_test_fsync_sync_001
* @tc.desc Test fsyncSync() interface. Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_sync_001
'
,
0
,
function
()
{
try
{
fileIO
.
fsyncSync
(
-
1
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_sync_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900008
&&
e
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_SYNC_0020
* @tc.name fileIO_test_fsync_sync_002
* @tc.desc Test fsyncSync() interface. Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_sync_002
'
,
0
,
function
()
{
try
{
fileIO
.
fsyncSync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_sync_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_0000
* @tc.name fileIO_test_fsync_async_000
* @tc.desc Test fsync() interface. await Promise.
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_000
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fsync_async_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
await
fileIO
.
fsync
(
file
.
fd
);
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_0010
* @tc.name fileIO_test_fsync_async_001
* @tc.desc Test fsync() interface. Promise.then().catch()
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_001
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fsync_async_001
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
fileIO
.
fsync
(
file
.
fd
).
then
(()
=>
{
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
done
();
}).
catch
((
err
)
=>
{
console
.
log
(
'
fileIO_test_fsync_async_001 error package:
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_002
* @tc.name fileIO_test_fsync_async_002
* @tc.desc Test fsync() interface. Callback.
* Open the file in read-write mode, and synchronize the file content data.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_002
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileIO_test_fsync_sync_002
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
file
=
fileIO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
READ_WRITE
);
fileIO
.
fsync
(
file
.
fd
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
fileIO_test_fsync_async_002 error package:
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
}
fileio
.
closeSync
(
file
.
fd
);
fileio
.
unlinkSync
(
fpath
);
});
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_003
* @tc.name fileIO_test_fsync_async_003
* @tc.desc Test fsync() interface. await Promise.
* Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_003
'
,
0
,
async
function
(
done
)
{
try
{
await
fileIO
.
fsync
(
-
1
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_003 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900008
&&
e
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_004
* @tc.name fileIO_test_fsync_async_004
* @tc.desc Test fsync() interface. Callback.
* Invalid fd parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_004
'
,
0
,
async
function
(
done
)
{
try
{
fileIO
.
fsync
(
-
1
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
fileIO_test_fsync_async_004 error package: {
'
+
err
.
message
+
'
, code:
'
+
err
.
code
+
'
}
'
);
expect
(
err
.
code
==
13900008
&&
err
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
done
();
}
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_004 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_005
* @tc.name fileIO_test_fsync_async_005
* @tc.desc Test fsync() interface. Promise.then().catch()
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_005
'
,
0
,
async
function
(
done
)
{
try
{
fileIO
.
fsync
(
-
1
).
then
(()
=>
{
expect
(
false
).
assertTrue
();
}).
catch
((
err
)
=>
{
console
.
log
(
'
fileIO_test_fsync_async_005 error package: {
'
+
err
.
message
+
'
, code:
'
+
err
.
code
+
'
}
'
);
expect
(
err
.
code
==
13900008
&&
err
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_005 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_006
* @tc.name fileIO_test_fsync_async_006
* @tc.desc Test fsync() interface. await Promise.
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_006
'
,
0
,
async
function
(
done
)
{
try
{
await
fileIO
.
fsync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_006 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_FSYNC_ASYNC_006
* @tc.name fileIO_test_fsync_async_006
* @tc.desc Test fsync() interface. Callback.
* Missing parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileIO_test_fsync_async_007
'
,
0
,
async
function
(
done
)
{
try
{
fileIO
.
fsync
(()
=>
{
expect
(
false
).
assertTrue
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileIO_test_fsync_async_007 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
'
Invalid argument
'
).
assertTrue
();
done
();
}
});
})
}
storage/storagefileiov9jstest/src/main/js/test/members/stat.test.js
浏览文件 @
ebd5553e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录