Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f2af6790
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,发现更多精彩内容 >>
提交
f2af6790
编写于
5月 25, 2022
作者:
R
raoxian
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update FileIOError testcasename
Signed-off-by:
N
raoxian
<
raoxian@huawei.com
>
上级
67240b13
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
56 addition
and
56 deletion
+56
-56
storage/storagefileioerrorjstest/src/main/js/default/test/FileIOError.test.js
...oerrorjstest/src/main/js/default/test/FileIOError.test.js
+56
-56
未找到文件。
storage/storagefileioerrorjstest/src/main/js/default/test/FileIOError.test.js
浏览文件 @
f2af6790
...
...
@@ -34,13 +34,13 @@ from './Common'
describe
(
'
FileIOError
'
,
function
()
{
/**
* @tc.number SUB_STORAGE_FileIo_test_error_0
9
00
* @tc.name
FileIo_test_error_009
* @tc.number SUB_STORAGE_FileIo_test_error_0
0
00
* @tc.name
fileio_test_error_000
* @tc.desc Function of API, Delete directories with files
*/
it
(
'
FileIo_test_error_009
'
,
0
,
function
()
{
let
dpath
=
fileName
(
'
fileio_test_error_00
9
d
'
);
let
fpath
=
dpath
+
'
/fileio_test_error_00
9
f
'
;
it
(
'
fileio_test_error_000
'
,
0
,
function
()
{
let
dpath
=
fileName
(
'
fileio_test_error_00
0
d
'
);
let
fpath
=
dpath
+
'
/fileio_test_error_00
0
f
'
;
fileio
.
mkdirSync
(
dpath
);
expect
(
prepareFile
(
fpath
,
'
hello
'
)).
assertTrue
();
try
{
...
...
@@ -49,7 +49,7 @@ describe('FileIOError', function () {
fileio
.
rmdirSync
(
dpath
);
}
catch
(
err
)
{
console
.
log
(
'
fileio_test_error_00
9
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_00
0
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Directory not empty
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
fileio
.
rmdirSync
(
dpath
);
...
...
@@ -57,12 +57,12 @@ describe('FileIOError', function () {
});
/**
* @tc.number SUB_STORAGE_FileIo_test_error_
10
00
* @tc.name
FileIo_test_error_010
* @tc.number SUB_STORAGE_FileIo_test_error_
01
00
* @tc.name
fileio_test_error_001
* @tc.desc Function of API, delete file
*/
it
(
'
FileIo_test_error_010
'
,
0
,
function
()
{
let
fpath
=
fileName
(
'
fileio_test_error_0
10
f
'
);
it
(
'
fileio_test_error_001
'
,
0
,
function
()
{
let
fpath
=
fileName
(
'
fileio_test_error_0
01
f
'
);
expect
(
prepareFile
(
fpath
,
'
hello
'
)).
assertTrue
();
try
{
let
fd
=
fileio
.
openSync
(
fpath
);
...
...
@@ -71,110 +71,110 @@ describe('FileIOError', function () {
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
fileio_test_error_0
10
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_0
01
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Not a directory
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIo_test_error_
1
200
* @tc.name
FileIo_test_error_01
2
* @tc.number SUB_STORAGE_FileIo_test_error_
0
200
* @tc.name
fileio_test_error_00
2
* @tc.desc Function of API, flags=0o102. missing mode parameter.
*/
it
(
'
FileIo_test_error_01
2
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_01
2
'
);
it
(
'
fileio_test_error_00
2
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_00
2
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileio
.
openSync
(
fpath
,
0o102
);
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_01
2 has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_00
2 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
called with O_CREAT/O_TMPFILE but no mode
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
1
300
* @tc.name
FileIo_test_error_01
3
* @tc.number SUB_STORAGE_FileIO_OpenSync_
0
300
* @tc.name
fileio_test_error_00
3
* @tc.desc Function of API, flags=0o102, missing mode parameter.
*/
it
(
'
FileIo_test_error_01
3
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_01
3
'
);
it
(
'
fileio_test_error_00
3
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_00
3
'
);
try
{
fileio
.
openSync
(
fpath
,
0o102
);
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_01
3 has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_00
3 has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
called with O_CREAT/O_TMPFILE but no mode
'
)).
assertTrue
();
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
15
00
* @tc.name
FileIo_test_error_015
* @tc.number SUB_STORAGE_FileIO_OpenSync_
04
00
* @tc.name
fileio_test_error_004
* @tc.desc Function of API, flags=0o302. The test file is exist.
*/
it
(
'
FileIo_test_error_015
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_015
'
);
it
(
'
fileio_test_error_004
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_004
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileio
.
openSync
(
fpath
,
0o302
,
0o666
);
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_015
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_004
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
File exists
'
)).
assertTrue
();
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
16
00
* @tc.name
FileIo_test_error_016
* @tc.number SUB_STORAGE_FileIO_OpenSync_
05
00
* @tc.name
fileio_test_error_005
* @tc.desc Function of API, flags=0o100002. The test file is exist.
*/
it
(
'
FileIo_test_error_016
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_016
'
);
it
(
'
fileio_test_error_005
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_005
'
);
expect
(
prepareFile
(
fpath
,
FILE_CONTENT
)).
assertTrue
();
try
{
fileio
.
openSync
(
fpath
,
0o100002
);
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_016
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_005
has failed for
'
+
err
);
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
17
00
* @tc.name
FileIo_test_error_017
* @tc.number SUB_STORAGE_FileIO_OpenSync_
06
00
* @tc.name
fileio_test_error_006
* @tc.desc Function of API, flags=0o40002 The test file is exist.
*/
it
(
'
FileIo_test_error_017
'
,
0
,
function
()
{
let
dpath
=
nextFileName
(
'
FileIo_test_error_017
'
);
it
(
'
fileio_test_error_006
'
,
0
,
function
()
{
let
dpath
=
nextFileName
(
'
fileio_test_error_006
'
);
fileio
.
mkdirSync
(
dpath
);
try
{
fileio
.
openSync
(
dpath
,
0o40002
);
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_017
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_006
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
called with O_CREAT/O_TMPFILE but no mode
'
)).
assertTrue
();
fileio
.
rmdirSync
(
dpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
19
00
* @tc.name
FileIo_test_error_019
* @tc.number SUB_STORAGE_FileIO_OpenSync_
07
00
* @tc.name
fileio_test_error_007
* @tc.desc Function of API, flags=0o400002. The test file is exist.
*/
it
(
'
FileIo_test_error_019
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_019
'
);
it
(
'
fileio_test_error_007
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_007
'
);
let
txt
=
'
h
'
expect
(
prepareFile
(
fpath
,
txt
)).
assertTrue
();
try
{
...
...
@@ -182,18 +182,18 @@ describe('FileIOError', function () {
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_019
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_007
has failed for
'
+
err
);
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
20
00
* @tc.name
FileIo_test_error_020
* @tc.number SUB_STORAGE_FileIO_OpenSync_
08
00
* @tc.name
fileio_test_error_008
* @tc.desc Function of API, flags=0o400002. The test file is exist.
*/
it
(
'
FileIo_test_error_020
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_020
'
);
it
(
'
fileio_test_error_008
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_008
'
);
let
txt
=
randomString
(
5000
);
expect
(
prepareFile
(
fpath
,
txt
)).
assertTrue
();
try
{
...
...
@@ -201,42 +201,42 @@ describe('FileIOError', function () {
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_020
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_008
has failed for
'
+
err
);
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
21
00
* @tc.name
FileIo_test_error_021
* @tc.number SUB_STORAGE_FileIO_OpenSync_
09
00
* @tc.name
fileio_test_error_009
* @tc.desc Function of API, flags=0o10000102. The test file is exist.
*/
it
(
'
FileIo_test_error_021
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
FileIo_test_error_021
'
);
it
(
'
fileio_test_error_009
'
,
0
,
function
()
{
let
fpath
=
nextFileName
(
'
fileio_test_error_009
'
);
try
{
fileio
.
openSync
(
fpath
,
0o10000102
);
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_021
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_009
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
called with O_CREAT/O_TMPFILE but no mode
'
)).
assertTrue
();
}
});
/**
* @tc.number SUB_STORAGE_FileIO_OpenSync_
23
00
* @tc.name
FileIo_test_error_023
* @tc.number SUB_STORAGE_FileIO_OpenSync_
10
00
* @tc.name
fileio_test_error_010
* @tc.desc Function of API, flags=0o200000. Invalid argument.
*/
it
(
'
FileIo_test_error_023
'
,
0
,
function
()
{
let
dpath
=
fileName
(
'
FileIo_test_error_023
d
'
);
it
(
'
fileio_test_error_010
'
,
0
,
function
()
{
let
dpath
=
fileName
(
'
fileio_test_error_010
d
'
);
fileio
.
mkdirSync
(
dpath
);
try
{
fileio
.
openSync
(
dpath
,
0o200000
);
expect
(
null
).
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
FileIo_test_error_023
has failed for
'
+
err
);
console
.
log
(
'
fileio_test_error_010
has failed for
'
+
err
);
expect
(
isInclude
(
err
.
message
,
'
Invalid argument
'
)).
assertTrue
();
fileio
.
rmdirSync
(
dpath
);
}
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
5b19a011
·
7月 15, 2022
mentioned in commit
5b19a011
mentioned in commit 5b19a01137ca259a54cf8a08e53643fc072b4d75
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录