Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b644555f
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看板
提交
b644555f
编写于
6月 16, 2022
作者:
Z
zhangxingxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update fileio xts
Signed-off-by:
N
zhangxingxia
<
zhangxingxia1@huawei.com
>
上级
4a056d7c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
23 deletion
+49
-23
storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/close.test.js
.../main/js/default/test/module_fileio/members/close.test.js
+49
-23
未找到文件。
storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/close.test.js
浏览文件 @
b644555f
...
...
@@ -20,47 +20,69 @@ import {
describe
(
'
fileio_close
'
,
function
()
{
/**
* @tc.number SUB_DF_FILEIO_CLOSESYNC_0000
* @tc.name fileio_test_close_sync_000
* @tc.desc Test closeSync() interfaces
* @tc.size MEDIUM(中型)
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_close_sync_000
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_test_close_async_000
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
let
fd
=
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
fileio
.
closeSync
(
fd
);
fileio
.
unlinkSync
(
fpath
);
}
catch
(
e
)
{
console
.
info
(
'
fileio_test_close_sync_000 has failed for
'
+
e
);
}
})
/**
* @tc.number SUB_DF_FILEIO_CLOSESYNC_0100
* @tc.name fileio_test_close_sync_001
* @tc.desc Test closeSync() interfaces,No parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_close_sync_00
0
'
,
0
,
function
()
{
it
(
'
fileio_test_close_sync_00
1
'
,
0
,
function
()
{
try
{
fileio
.
closeSync
();
expect
(
null
).
assertFail
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_test_close_sync_000 has failed for
'
+
e
);
console
.
info
(
'
fileio_test_close_sync_001 has failed for
'
+
e
);
expect
(
e
.
message
==
'
Number of arguments unmatched
'
).
assertTrue
();
}
})
/**
* @tc.number SUB_DF_FILEIO_CLOSESYNC_0010
* @tc.name fileio_test_close_sync_001
* @tc.desc Test closeSync() interfaces
* @tc.size MEDIUM
(中型)
* @tc.desc Test closeSync() interfaces
,fd is illegal.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_close_sync_00
1
'
,
0
,
function
()
{
it
(
'
fileio_test_close_sync_00
2
'
,
0
,
function
()
{
try
{
fileio
.
closeSync
(
-
1
);
expect
(
null
).
assertFail
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_test_close_sync_001 has failed for
'
+
e
);
console
.
info
(
'
fileio_test_close_sync_002 has failed for
'
+
e
);
expect
(
e
.
message
==
'
Bad file descriptor
'
).
assertTrue
();
}
})
/**
* @tc.number SUB_DF_FILEIO_CLOSE_ASYNC_0000
* @tc.name fileio_test_close_async_000
* @tc.desc Test close() interfaces
* @tc.size MEDIUM
(中型)
* @tc.desc Test close() interfaces
,return in callback mode.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
...
...
@@ -72,11 +94,11 @@ describe('fileio_close', function () {
try
{
let
fd
=
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
fileio
.
close
(
fd
,
function
(
err
)
{
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
(
);
fileio
.
unlinkSync
(
fpath
);
done
();
});
}
catch
(
e
)
{
console
.
log
(
'
fileio_test_close_async_000 has failed for
'
+
e
);
console
.
info
(
'
fileio_test_close_async_000 has failed for
'
+
e
);
expect
(
null
).
assertFail
();
}
})
...
...
@@ -84,8 +106,8 @@ describe('fileio_close', function () {
/**
* @tc.number SUB_DF_FILEIO_CLOSE_ASYNC_0010
* @tc.name fileio_test_close_async_001
* @tc.desc Test close() interfaces
* @tc.size MEDIUM
(中型)
* @tc.desc Test close() interfaces
,return in promise mode.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
...
...
@@ -100,7 +122,7 @@ describe('fileio_close', function () {
expect
(
fileio
.
unlinkSync
(
fpath
)
==
null
).
assertTrue
();
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_test_close_async_001 has failed for
'
+
e
);
console
.
info
(
'
fileio_test_close_async_001 has failed for
'
+
e
);
expect
(
null
).
assertFail
();
}
})
...
...
@@ -108,20 +130,24 @@ describe('fileio_close', function () {
/**
* @tc.number SUB_DF_FILEIO_CLOSE_ASYNC_0020
* @tc.name fileio_test_close_async_002
* @tc.desc Test close() interfaces
* @tc.size MEDIUM
(中型)
* @tc.desc Test close() interfaces
,there are multiple parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_close_async_002
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_close_async_001
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
await
fileio
.
close
(
-
1
);
expect
(
null
).
assertFail
();
done
(
);
let
fd
=
fileio
.
openSync
(
fpath
,
0o102
,
0o666
);
fileio
.
close
(
fd
,
2
,
function
(
err
)
{
}
);
}
catch
(
e
)
{
expect
(
!!
e
).
assertTrue
(
);
console
.
log
(
'
fileio_test_close_async_002 has failed for
'
+
e
);
console
.
info
(
'
fileio_test_close_async_002 has failed for
'
+
e
);
expect
(
e
.
message
==
"
Number of arguments unmatched
"
).
assertTrue
(
);
done
();
}
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录