Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3f3b45c9
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看板
未验证
提交
3f3b45c9
编写于
9月 01, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9868 Supplemental XTS testcases for synchronous interfaces.
Merge pull request !9868 from 冯俊青/copyDirSync
上级
5342630b
081cb86c
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1051 addition
and
25 deletion
+1051
-25
storage/storagefileiov9jstest/src/main/js/test/members/copyDir.test.js
...gefileiov9jstest/src/main/js/test/members/copyDir.test.js
+362
-12
storage/storagefileiov9jstest/src/main/js/test/members/moveDir.test.js
...gefileiov9jstest/src/main/js/test/members/moveDir.test.js
+487
-9
storage/storagestatfsjstest/src/main/js/test/statvfs.test.js
storage/storagestatfsjstest/src/main/js/test/statvfs.test.js
+202
-4
未找到文件。
storage/storagefileiov9jstest/src/main/js/test/members/copyDir.test.js
浏览文件 @
3f3b45c9
此差异已折叠。
点击以展开。
storage/storagefileiov9jstest/src/main/js/test/members/moveDir.test.js
浏览文件 @
3f3b45c9
此差异已折叠。
点击以展开。
storage/storagestatfsjstest/src/main/js/test/statvfs.test.js
浏览文件 @
3f3b45c9
/*
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
3
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -19,6 +19,204 @@ import featureAbility from '@ohos.ability.featureAbility';
...
@@ -19,6 +19,204 @@ import featureAbility from '@ohos.ability.featureAbility';
export
default
function
statvfs_test
()
{
export
default
function
statvfs_test
()
{
describe
(
'
statvfs_test
'
,
function
()
{
describe
(
'
statvfs_test
'
,
function
()
{
/**
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_SYNC_0000
* @tc.name statvfs_test_get_free_size_sync_000
* @tc.desc Test getFreeSizeSync() interfaces, when the path is a sandbox path, promise way back.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
statvfs_test_get_free_size_sync_000
'
,
0
,
async
function
()
{
try
{
let
context
=
featureAbility
.
getContext
();
let
data
=
await
context
.
getFilesDir
();
let
number
=
statvfs
.
getFreeSizeSync
(
data
);
console
.
log
(
"
getFreeSize getFilesDir===>
"
+
(
number
/
1024
));
expect
(
isIntNum
(
number
)).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_free_size_sync_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_SYNC_0100
* @tc.name statvfs_test_get_free_size_sync_001
* @tc.desc Test getFreeSizeSync() interfaces, when the path is dev, callback way back.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
statvfs_test_get_free_size_sync_001
'
,
0
,
async
function
()
{
try
{
let
number
=
statvfs
.
getFreeSizeSync
(
"
/dev
"
);
console
.
log
(
"
getFreeSizeNumber dev===>:
"
+
(
number
/
1024
));
expect
(
isIntNum
(
number
)).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_free_size_sync_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_SYNC_0200
* @tc.name statvfs_test_get_free_size_sync_002
* @tc.desc Test getFreeSizeSync() interfaces, when the parameter type is wrong.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it
(
'
statvfs_test_get_free_size_sync_002
'
,
3
,
async
function
()
{
try
{
statvfs
.
getFreeSizeSync
(
1
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_free_size_sync_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
"
Invalid argument
"
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_SYNC_0300
* @tc.name statvfs_test_get_free_size_sync_003
* @tc.desc Test getFreeSizeSync() interfaces, when there are no parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it
(
'
statvfs_test_get_free_size_sync_003
'
,
3
,
async
function
()
{
try
{
statvfs
.
getFreeSizeSync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_free_size_sync_003 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
"
Invalid argument
"
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_SYNC_0500
* @tc.name statvfs_test_get_free_size_sync_005
* @tc.desc Test getFreeSizeSync() interfaces, when the path is empty.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it
(
'
statvfs_test_get_free_size_sync_005
'
,
3
,
async
function
()
{
try
{
statvfs
.
getFreeSizeSync
(
""
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_free_size_sync_005 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900002
&&
e
.
message
==
'
No such file or directory
'
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_SYNC_0000
* @tc.name statvfs_test_get_total_size_sync_000
* @tc.desc Test getTotalSizeSync() interfaces, when the path is a sandbox path, promise way back.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
statvfs_test_get_total_size_sync_000
'
,
0
,
async
function
()
{
try
{
let
context
=
featureAbility
.
getContext
();
let
data
=
await
context
.
getFilesDir
();
let
number
=
statvfs
.
getTotalSizeSync
(
data
);
console
.
log
(
"
getTotalSizeNumber GetFilesDir====>:
"
+
(
number
/
1024
));
expect
(
isIntNum
(
number
)).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_total_size_sync_000 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_SYNC_0100
* @tc.name statvfs_test_get_total_size_sync_001
* @tc.desc Test getTotalSizeSync() interfaces, when the path is dev, callback way back.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
statvfs_test_get_total_size_sync_001
'
,
0
,
async
function
()
{
try
{
let
number
=
statvfs
.
getTotalSizeSync
(
"
/dev
"
);
console
.
log
(
"
getTotalSizeNumber dev===>:
"
+
(
number
/
1024
));
expect
(
isIntNum
(
number
)).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_total_size_sync_001 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
false
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_SYNC_0200
* @tc.name statvfs_test_get_total_size_sync_002
* @tc.desc Test getTotalSizeSync() interfaces, when the parameter type is wrong.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it
(
'
statvfs_test_get_total_size_sync_002
'
,
3
,
async
function
()
{
try
{
statvfs
.
getTotalSizeSync
(
1
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_total_size_sync_002 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
"
Invalid argument
"
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_SYNC_0300
* @tc.name statvfs_test_get_total_size_sync_003
* @tc.desc Test getTotalSizeSync() interfaces, when there are no parameters.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it
(
'
statvfs_test_get_total_size_sync_003
'
,
3
,
async
function
()
{
try
{
statvfs
.
getTotalSizeSync
();
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_total_size_sync_003 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900020
&&
e
.
message
==
"
Invalid argument
"
).
assertTrue
();
}
});
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_SYNC_0400
* @tc.name statvfs_test_get_total_size_sync_004
* @tc.desc Test getTotalSizeSync() interfaces, when the path is empty.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 3
* @tc.require
*/
it
(
'
statvfs_test_get_total_size_sync_004
'
,
3
,
async
function
()
{
try
{
statvfs
.
getTotalSizeSync
(
""
);
expect
(
false
).
assertTrue
();
}
catch
(
e
)
{
console
.
log
(
'
statvfs_test_get_total_size_sync_004 has failed for
'
+
e
.
message
+
'
, code:
'
+
e
.
code
);
expect
(
e
.
code
==
13900002
&&
e
.
message
==
'
No such file or directory
'
).
assertTrue
();
}
});
/**
/**
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_0000
* @tc.number SUB_DF_STATFS_GET_FREE_SIZE_0000
* @tc.name statvfs_test_get_free_size_async_000
* @tc.name statvfs_test_get_free_size_async_000
...
@@ -203,7 +401,7 @@ describe('statvfs_test', function () {
...
@@ -203,7 +401,7 @@ describe('statvfs_test', function () {
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
}
}
});
});
/**
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_0200
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_0200
* @tc.name statvfs_test_get_total_size_async_002
* @tc.name statvfs_test_get_total_size_async_002
...
@@ -224,7 +422,7 @@ describe('statvfs_test', function () {
...
@@ -224,7 +422,7 @@ describe('statvfs_test', function () {
done
();
done
();
}
}
});
});
/**
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_0300
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_0300
* @tc.name statvfs_test_get_total_size_async_003
* @tc.name statvfs_test_get_total_size_async_003
...
@@ -245,7 +443,7 @@ describe('statvfs_test', function () {
...
@@ -245,7 +443,7 @@ describe('statvfs_test', function () {
done
();
done
();
}
}
});
});
/**
/**
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_0400
* @tc.number SUB_DF_STATFS_GET_TOTAL_SIZE_0400
* @tc.name statvfs_test_get_total_size_async_004
* @tc.name statvfs_test_get_total_size_async_004
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录