Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5788c139
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看板
未验证
提交
5788c139
编写于
8月 02, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4726 【storage】【Release3.1】修改mkdir_rmdir.test.js测试套XTS用例
Merge pull request !4726 from 金海/mkdir_rmdir_fxb0730_3.1_release
上级
0ca11119
dcb6825d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
180 addition
and
54 deletion
+180
-54
storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/mkdir_rmdir.test.js
...js/default/test/module_fileio/members/mkdir_rmdir.test.js
+180
-54
未找到文件。
storage/storagefileiojstest/src/main/js/default/test/module_fileio/members/mkdir_rmdir.test.js
浏览文件 @
5788c139
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
{
fileio
,
nextFileName
,
describe
,
it
,
expect
}
from
'
../../Common
'
;
import
{
fileio
,
nextFileName
,
describe
,
it
,
expect
,
isIntNum
}
from
'
../../Common
'
;
describe
(
'
fileio_mkdir_rmdir
'
,
function
()
{
...
...
@@ -28,20 +28,27 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_sync_rmdir_sync_000
'
,
0
,
async
function
()
{
let
dpath
=
await
nextFileName
(
'
fileio_mkdir_sync_rmdir_sync_000
'
)
+
'
d
'
;
try
{
expect
(
fileio
.
mkdirSync
(
dpath
)
==
null
).
assertTrue
();
expect
(
fileio
.
rmdirSync
(
dpath
)
==
null
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_sync_rmdir_sync_000 has failed for
'
+
e
);
expect
(
null
).
assertFail
();
fileio
.
mkdirSync
(
dpath
);
expect
((
fileio
.
opendirSync
(
dpath
))
!=
null
).
assertTrue
();
console
.
info
(
'
fileio_mkdir_sync_rmdir_sync_000 has mkdir SUCCESS
'
);
fileio
.
rmdirSync
(
dpath
);
}
catch
(
e
)
{
console
.
info
(
'
fileio_mkdir_sync_rmdir_sync_000 has failed for
'
+
e
);
expect
(
false
).
assertTrue
();
}
try
{
fileio
.
opendirSync
(
dpath
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
No such file or directory
'
)
!=
-
1
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0
01
0
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0
10
0
* @tc.name fileio_mkdir_sync_rmdir_sync_001
* @tc.desc Test mkdirSync() interfaces
.
* @tc.desc Test mkdirSync() interfaces
,Path parameter passing '/'
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -49,17 +56,17 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_sync_rmdir_sync_001
'
,
0
,
function
()
{
try
{
expect
(
fileio
.
mkdirSync
(
'
/
'
)
==
null
).
assertTrue
(
);
expect
(
null
).
assertFail
();
fileio
.
mkdirSync
(
'
/
'
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_sync_rmdir_sync_001 has failed for
'
+
e
);
expect
(
e
.
toString
().
indexOf
(
'
File exists
'
)
!=
-
1
).
assertTrue
(
);
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0
02
0
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0
20
0
* @tc.name fileio_mkdir_sync_rmdir_sync_002
* @tc.desc Test mkdirSync() interfaces
.
* @tc.desc Test mkdirSync() interfaces
,Path parameter passes invalid path 12
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -67,17 +74,71 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_sync_rmdir_sync_002
'
,
0
,
function
()
{
try
{
expect
(
fileio
.
mkdirSync
(
12
)
==
null
).
assertTrue
();
expect
(
null
).
assertFail
();
fileio
.
mkdirSync
(
12
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Invalid path
'
)
!=
-
1
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0300
* @tc.name fileio_mkdir_sync_rmdir_sync_003
* @tc.desc Test mkdirSync() interfaces,Path passes null parameter
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_mkdir_sync_rmdir_sync_003
'
,
0
,
function
()
{
try
{
fileio
.
mkdirSync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_sync_rmdir_sync_002 has failed for
'
+
e
);
expect
(
e
.
toString
().
indexOf
(
'
Number of arguments unmatched
'
)
!=
-
1
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0400
* @tc.name fileio_mkdir_sync_rmdir_sync_004
* @tc.desc Test rmdirSync() interfaces,Path parameter passes invalid path 12
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_mkdir_sync_rmdir_sync_004
'
,
0
,
function
()
{
try
{
fileio
.
rmdirSync
(
12
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Invalid path
'
)
!=
-
1
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_SYNC_0500
* @tc.name fileio_mkdir_sync_rmdir_sync_005
* @tc.desc Test rmdirSync() interfaces,Path passes null parameter
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_mkdir_sync_rmdir_sync_005
'
,
0
,
function
()
{
try
{
fileio
.
rmdirSync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Number of arguments unmatched
'
)
!=
-
1
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0000
* @tc.name fileio_mkdir_async_rmdir_sync_000
* @tc.desc Test mkdir
Async() and rmdirSync() interfaces
.
* @tc.desc Test mkdir
() interfaces(promise)
.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -85,21 +146,22 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_async_rmdir_sync_000
'
,
0
,
async
function
(
done
)
{
let
dpath
=
await
nextFileName
(
'
fileio_mkdir_async_rmdir_sync_000
'
)
+
'
d
'
;
try
{
expect
(
await
fileio
.
mkdir
(
dpath
)
==
null
).
assertTrue
();
expect
(
fileio
.
rmdirSync
(
dpath
)
==
null
).
assertTrue
();
await
fileio
.
mkdir
(
dpath
);
expect
((
fileio
.
opendirSync
(
dpath
))
!=
null
).
assertTrue
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_000 has mkdir SUCCESS
'
);
fileio
.
rmdirSync
(
dpath
);
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_async_rmdir_sync_000 has
failed for
'
+
e
);
expect
(
null
).
assertFail
();
}
catch
(
e
)
{
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_000 has mkdir
failed for
'
+
e
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
01
0
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
10
0
* @tc.name fileio_mkdir_async_rmdir_sync_001
* @tc.desc Test
mkdirAsync() and rmdirSync() interfaces.
* @tc.desc Test
mkdir() interfaces (callback)
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -107,22 +169,24 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_async_rmdir_sync_001
'
,
0
,
async
function
(
done
)
{
let
dpath
=
await
nextFileName
(
'
fileio_mkdir_async_rmdir_sync_001
'
)
+
'
d
'
;
try
{
fileio
.
mkdir
(
dpath
,
function
(
error
)
{
expect
(
fileio
.
rmdirSync
(
dpath
)
==
null
).
assertTrue
();
done
();
expect
(
error
.
toString
().
indexOf
(
'
No error information
'
)
!=
-
1
).
assertTrue
();
expect
((
fileio
.
opendirSync
(
dpath
))
!=
null
).
assertTrue
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_001 has mkdir SUCCESS
'
);
fileio
.
rmdirSync
(
dpath
);
});
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_async_rmdir_sync_001 has
failed for
'
+
e
);
expect
(
null
).
assertFail
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_001 has mkdir
failed for
'
+
e
);
expect
(
false
).
assertTrue
();
}
done
();
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
02
0
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
20
0
* @tc.name fileio_mkdir_async_rmdir_sync_002
* @tc.desc Test mkdir
Async() and rmdirSync() interfaces.
* @tc.desc Test mkdir
() interfaces,mode parameter passing 777
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -130,21 +194,22 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_async_rmdir_sync_002
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_mkdir_async_rmdir_sync_002
'
);
try
{
expect
(
await
fileio
.
mkdir
(
fpath
,
777
)
==
null
).
assertTrue
();
expect
(
fileio
.
rmdirSync
(
fpath
)
==
null
).
assertTrue
();
await
fileio
.
mkdir
(
fpath
,
777
);
expect
((
fileio
.
opendirSync
(
fpath
))
!=
null
).
assertTrue
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_002 has mkdir SUCCESS
'
);
fileio
.
rmdirSync
(
fpath
);
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_async_rmdir_sync_002 has
failed for
'
+
e
);
expect
(
null
).
assertFail
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_002 has mkdir
failed for
'
+
e
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
03
0
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
30
0
* @tc.name fileio_mkdir_async_rmdir_sync_003
* @tc.desc Test mkdir
Async() and rmdirSync() interfaces.
* @tc.desc Test mkdir
() interfaces,mode parameter passing 400
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -152,21 +217,22 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_async_rmdir_sync_003
'
,
0
,
async
function
(
done
)
{
let
fpath
=
await
nextFileName
(
'
fileio_mkdir_async_rmdir_sync_003
'
);
try
{
expect
(
await
fileio
.
mkdir
(
fpath
,
400
)
==
null
).
assertTrue
();
expect
(
fileio
.
rmdirSync
(
fpath
)
==
null
).
assertTrue
();
await
fileio
.
mkdir
(
fpath
,
400
);
expect
((
fileio
.
opendirSync
(
fpath
))
!=
null
).
assertTrue
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_003 has mkdir SUCCESS
'
);
fileio
.
rmdirSync
(
fpath
);
done
();
}
catch
(
e
)
{
console
.
log
(
'
fileio_mkdir_async_rmdir_sync_003 has
failed for
'
+
e
);
expect
(
null
).
assertFail
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_003 has mkdir
failed for
'
+
e
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
04
0
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
40
0
* @tc.name fileio_mkdir_async_rmdir_sync_004
* @tc.desc Test mkdir
Async() and interfaces.
* @tc.desc Test mkdir
() interfaces,Path parameter passes invalid path 12
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -174,17 +240,18 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_async_rmdir_sync_004
'
,
0
,
async
function
(
done
)
{
try
{
expect
(
await
fileio
.
mkdir
(
12
)
==
null
).
assertTrue
(
);
expect
(
null
).
assertFail
();
await
fileio
.
mkdir
(
12
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Invalid path
'
)
!=
-
1
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
05
0
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0
50
0
* @tc.name fileio_mkdir_async_rmdir_sync_005
* @tc.desc Test mkdir
Async()interfaces.
* @tc.desc Test mkdir
() interfaces,Path parameter passing '/'
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
...
...
@@ -192,9 +259,68 @@ describe('fileio_mkdir_rmdir', function () {
*/
it
(
'
fileio_mkdir_async_rmdir_sync_005
'
,
0
,
async
function
(
done
)
{
try
{
expect
(
await
fileio
.
mkdir
(
'
/
'
).
indexOf
(
'
<pending>
'
)
>
-
1
).
assertTrue
();
expect
(
null
).
assertFail
();
await
fileio
.
mkdir
(
'
/
'
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
File exists
'
)
!=
-
1
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_ASYNC_RMDIR_SYNC_0600
* @tc.name fileio_mkdir_async_rmdir_sync_006
* @tc.desc Test mkdir() interfaces,Path passes null parameter
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_mkdir_async_rmdir_sync_006
'
,
0
,
async
function
(
done
)
{
try
{
await
fileio
.
mkdir
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Number of arguments unmatched
'
)
!=
-
1
).
assertTrue
();
console
.
info
(
'
fileio_mkdir_async_rmdir_sync_006 has failed for
'
+
e
);
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_ASYNC_0000
* @tc.name fileio_mkdir_sync_rmdir_async_000
* @tc.desc Test rmdir() and interfaces,Path parameter passes invalid path 12
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_mkdir_sync_rmdir_async_000
'
,
0
,
async
function
(
done
)
{
try
{
await
fileio
.
rmdir
(
12
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Invalid path
'
)
!=
-
1
).
assertTrue
();
done
();
}
});
/**
* @tc.number SUB_DF_FILEIO_MKDIR_SYNC_RMDIR_ASYNC_0100
* @tc.name fileio_mkdir_sync_rmdir_async_001
* @tc.desc Test rmdir() and interfaces,Path passes null parameter
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_mkdir_sync_rmdir_async_001
'
,
0
,
async
function
(
done
)
{
try
{
await
fileio
.
rmdir
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
expect
(
e
.
toString
().
indexOf
(
'
Number of arguments unmatched
'
)
!=
-
1
).
assertTrue
();
done
();
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录