Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
165261c7
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
165261c7
编写于
8月 12, 2022
作者:
R
raoxian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改fileioerror用例编号
Signed-off-by:
N
raoxian
<
raoxian@huawei.com
>
上级
03be2fd6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
25 deletion
+45
-25
storage/storagefileioerrorjstest/src/main/js/test/FileIOError.test.js
...agefileioerrorjstest/src/main/js/test/FileIOError.test.js
+45
-25
未找到文件。
storage/storagefileioerrorjstest/src/main/js/test/FileIOError.test.js
浏览文件 @
165261c7
...
...
@@ -34,12 +34,16 @@ export default function FileIOError() {
describe
(
'
FileIOError
'
,
function
()
{
/**
* @tc.number SUB_STORAGE_FileIo_test_error_0
1
00
* @tc.name fileio_test_error_00
1
* @tc.number SUB_STORAGE_FileIo_test_error_0
0
00
* @tc.name fileio_test_error_00
0
* @tc.desc Function of API, delete file
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_error_00
1
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
fileName
(
'
fileio_test_error_00
1
f
'
);
it
(
'
fileio_test_error_00
0
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
fileName
(
'
fileio_test_error_00
0
f
'
);
expect
(
prepareFile
(
fpath
,
'
hello
'
)).
assertTrue
();
try
{
let
fd
=
fileio
.
openSync
(
fpath
);
...
...
@@ -47,7 +51,7 @@ describe('FileIOError', function () {
fileio
.
rmdirSync
(
fpath
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_error_00
1
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_error_00
0
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
done
();
...
...
@@ -55,18 +59,22 @@ describe('FileIOError', function () {
});
/**
* @tc.number SUB_STORAGE_FileIo_test_error_0
2
00
* @tc.name fileio_test_error_00
2
* @tc.number SUB_STORAGE_FileIo_test_error_0
1
00
* @tc.name fileio_test_error_00
1
* @tc.desc Function of API, flags=0o100. missing mode parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_error_00
2
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
2
'
);
it
(
'
fileio_test_error_00
1
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
1
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileio
.
openSync
(
fpath
,
0o100
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_error_00
2
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_error_00
1
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
called with O_CREAT/O_TMPFILE but no mode
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
done
();
...
...
@@ -74,18 +82,22 @@ describe('FileIOError', function () {
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_0
3
00
* @tc.name fileio_test_error_00
3
* @tc.number SUB_STORAGE_FileIO_OpenSync_0
2
00
* @tc.name fileio_test_error_00
2
* @tc.desc Function of API, flags=0o302. The test file is exist.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_error_00
3
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
3
'
);
it
(
'
fileio_test_error_00
2
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
2
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileio
.
openSync
(
fpath
,
0o302
,
0o666
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_error_00
3
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_error_00
2
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
File exists
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
done
();
...
...
@@ -93,12 +105,16 @@ describe('FileIOError', function () {
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_0
4
00
* @tc.name fileio_test_error_00
4
* @tc.number SUB_STORAGE_FileIO_OpenSync_0
3
00
* @tc.name fileio_test_error_00
3
* @tc.desc Function of API, flags=0o400000. Symbolic link loop.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_error_00
4
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
4
'
);
it
(
'
fileio_test_error_00
3
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
3
'
);
let
ffpath
=
fpath
+
'
aaaa
'
;
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
...
...
@@ -106,7 +122,7 @@ describe('FileIOError', function () {
fileio
.
openSync
(
ffpath
,
0o400000
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_error_00
4
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_error_00
3
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Symbolic link loop
'
)
||
isInclude
(
err
.
message
,
'
Too many symbolic links encountered
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
...
...
@@ -116,18 +132,22 @@ describe('FileIOError', function () {
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_0
5
00
* @tc.name fileio_test_error_00
5
* @tc.number SUB_STORAGE_FileIO_OpenSync_0
4
00
* @tc.name fileio_test_error_00
4
* @tc.desc Function of API, flags=0o200000. Not a directory.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_test_error_00
5
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
5
'
);
it
(
'
fileio_test_error_00
4
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_test_error_00
4
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileio
.
openSync
(
fpath
,
0o200000
,
0o666
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_test_error_00
5
has failed for
'
+
err
);
console
.
info
(
'
fileio_test_error_00
4
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录