Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6761a358
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看板
提交
6761a358
编写于
8月 30, 2022
作者:
R
raoxian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增randomaccessfile测试用例
Signed-off-by:
N
raoxian
<
raoxian@huawei.com
>
上级
b510db8c
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
2445 addition
and
0 deletion
+2445
-0
storage/storagefileiojstest/src/main/js/test/List.test.js
storage/storagefileiojstest/src/main/js/test/List.test.js
+10
-0
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/close.test.js
...s/test/module_fileio/class_randomAccessFile/close.test.js
+69
-0
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/read.test.js
...js/test/module_fileio/class_randomAccessFile/read.test.js
+769
-0
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/setFilePointer.test.js
...dule_fileio/class_randomAccessFile/setFilePointer.test.js
+94
-0
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/write.test.js
...s/test/module_fileio/class_randomAccessFile/write.test.js
+740
-0
storage/storagefileiojstest/src/main/js/test/module_fileio/members/createRandomAccessFile.test.js
...test/module_fileio/members/createRandomAccessFile.test.js
+763
-0
未找到文件。
storage/storagefileiojstest/src/main/js/test/List.test.js
浏览文件 @
6761a358
...
...
@@ -23,6 +23,10 @@ import fileioDirListfile from './module_fileio/class_dir/listfile.test.js'
import
fileioDirRead
from
'
./module_fileio/class_dir/read.test.js
'
import
fileioDirent
from
'
./module_fileio/class_dirent/all.test.js
'
import
fileioStream
from
'
./module_fileio/class_stream/all.test.js
'
import
fileioRandomAccessFileClose
from
'
./module_fileio/class_randomAccessFile/close.test.js
'
import
fileioRandomAccessFileRead
from
'
./module_fileio/class_randomAccessFile/read.test.js
'
import
fileioRandomAccessFileSetFilePointer
from
'
./module_fileio/class_randomAccessFile/setFilePointer.test.js
'
import
fileioRandomAccessFileWrite
from
'
./module_fileio/class_randomAccessFile/write.test.js
'
import
fileioStreamClose
from
'
./module_fileio/class_stream/close.test.js
'
import
fileioStreamFlush
from
'
./module_fileio/class_stream/flush.test.js
'
import
fileioStreamRead
from
'
./module_fileio/class_stream/read.test.js
'
...
...
@@ -33,6 +37,7 @@ import fileioChmod from './module_fileio/members/chmod.test.js'
import
fileioChown
from
'
./module_fileio/members/chown.test.js
'
import
fileioClose
from
'
./module_fileio/members/close.test.js
'
import
fileioCopyfile
from
'
./module_fileio/members/copyFile.test.js
'
import
fileioCreateRandomAccessFile
from
'
./module_fileio/members/createRandomAccessFile.test.js
'
import
fileioCreateStream
from
'
./module_fileio/members/createStream.test.js
'
import
fileioFchmod
from
'
./module_fileio/members/fchmod.test.js
'
import
fileioFchown
from
'
./module_fileio/members/fchown.test.js
'
...
...
@@ -71,6 +76,10 @@ export default function testsuite() {
fileioDirRead
()
fileioDirent
()
fileioStream
()
fileioRandomAccessFileClose
()
fileioRandomAccessFileRead
()
fileioRandomAccessFileSetFilePointer
()
fileioRandomAccessFileWrite
()
fileioStreamClose
()
fileioStreamFlush
()
fileioStreamRead
()
...
...
@@ -81,6 +90,7 @@ export default function testsuite() {
fileioChown
()
fileioClose
()
fileioCopyfile
()
fileioCreateRandomAccessFile
()
fileioCreateStream
()
fileioFchmod
()
fileioFchown
()
...
...
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/close.test.js
0 → 100644
浏览文件 @
6761a358
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
fileio
,
nextFileName
,
describe
,
it
,
expect
}
from
'
../../Common
'
;
export
default
function
fileioRandomAccessFileClose
()
{
describe
(
'
fileio_randomAccessFile_close
'
,
function
()
{
/**
* @tc.number SUB_STORAGE_FILEIO_RANDOMACCESSFILE_CLOSE_SYNC_0000
* @tc.name fileio_randomaccessfile_close_sync_000
* @tc.desc Test closeSync() interface. Close the RandomAccessFile object.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_randomaccessfile_close_sync_000
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_randomaccessfile_close_sync_000
'
);
try
{
let
randomaccessfile
=
fileio
.
createRandomAccessFileSync
(
fpath
,
0
,
0o102
);
randomaccessfile
.
closeSync
();
fileio
.
unlinkSync
(
fpath
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_randomaccessfile_close_sync_000 has failed for
'
+
err
);
expect
(
null
).
assertFail
();
}
});
/**
* @tc.number SUB_STORAGE_FILEIO_RANDOMACCESSFILE_CLOSE_SYNC_0100
* @tc.name fileio_randomaccessfile_close_sync_001
* @tc.desc Test closeSync() interface. Parameter mismatch.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_randomaccessfile_close_sync_001
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_randomaccessfile_close_sync_001
'
);
let
randomaccessfile
=
fileio
.
createRandomAccessFileSync
(
fpath
,
0
,
0o102
);
try
{
randomaccessfile
.
closeSync
(
1
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_randomaccessfile_close_sync_001 has failed for
'
+
err
);
expect
(
err
.
message
==
"
Number of arguments unmatched
"
).
assertTrue
();
randomaccessfile
.
closeSync
();
fileio
.
unlinkSync
(
fpath
);
}
});
})
}
\ No newline at end of file
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/read.test.js
0 → 100644
浏览文件 @
6761a358
此差异已折叠。
点击以展开。
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/setFilePointer.test.js
0 → 100644
浏览文件 @
6761a358
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
fileio
,
nextFileName
,
describe
,
it
,
expect
}
from
'
../../Common
'
;
export
default
function
fileioRandomAccessFileSetFilePointer
()
{
describe
(
'
fileio_randomAccessFile_setFilePointer
'
,
function
()
{
/**
* @tc.number SUB_STORAGE_FILEIO_RANDOMACCESSFILE_SET_FILE_POINTER_SYNC_0000
* @tc.name fileio_randomaccessfile_set_file_pointer_sync_000
* @tc.desc Test setFilePointerSync() interface. Set file offset pointer position.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_randomaccessfile_set_file_pointer_sync_000
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_randomaccessfile_set_file_pointer_sync_000
'
);
try
{
let
randomaccessfile
=
fileio
.
createRandomAccessFileSync
(
fpath
,
0
,
0o102
);
expect
(
randomaccessfile
.
fpointer
==
0
).
assertTrue
();
randomaccessfile
.
setFilePointerSync
(
5
);
expect
(
randomaccessfile
.
fpointer
==
5
).
assertTrue
();
randomaccessfile
.
closeSync
();
fileio
.
unlinkSync
(
fpath
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_randomaccessfile_set_file_pointer_sync_000 has failed for
'
+
err
);
expect
(
null
).
assertFail
();
}
});
/**
* @tc.number SUB_STORAGE_FILEIO_RANDOMACCESSFILE_SET_FILE_POINTER_SYNC_0100
* @tc.name fileio_randomaccessfile_set_file_pointer_sync_001
* @tc.desc Test setFilePointerSync() interface. Invalid fpointer.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_randomaccessfile_set_file_pointer_sync_001
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_randomaccessfile_set_file_pointer_sync_001
'
);
let
randomaccessfile
=
fileio
.
createRandomAccessFileSync
(
fpath
,
0
,
0o102
);
try
{
randomaccessfile
.
setFilePointerSync
(
'
5
'
);
}
catch
(
err
)
{
console
.
info
(
'
fileio_randomaccessfile_set_file_pointer_sync_001 has failed for
'
+
err
);
expect
(
err
.
message
==
"
Invalid fpointer
"
).
assertTrue
();
randomaccessfile
.
closeSync
();
fileio
.
unlinkSync
(
fpath
);
}
});
/**
* @tc.number SUB_STORAGE_FILEIO_RANDOMACCESSFILE_SET_FILE_POINTER_SYNC_0200
* @tc.name fileio_randomaccessfile_set_file_pointer_sync_002
* @tc.desc Test setFilePointerSync() interface. Missing Parameter.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 0
* @tc.require
*/
it
(
'
fileio_randomaccessfile_set_file_pointer_sync_002
'
,
0
,
async
function
()
{
let
fpath
=
await
nextFileName
(
'
fileio_randomaccessfile_set_file_pointer_sync_002
'
);
let
randomaccessfile
=
fileio
.
createRandomAccessFileSync
(
fpath
,
0
,
0o102
);
try
{
randomaccessfile
.
setFilePointerSync
();
}
catch
(
err
)
{
console
.
info
(
'
fileio_randomaccessfile_set_file_pointer_sync_002 has failed for
'
+
err
);
expect
(
err
.
message
==
"
Number of arguments unmatched
"
).
assertTrue
();
randomaccessfile
.
closeSync
();
fileio
.
unlinkSync
(
fpath
);
}
});
})
}
\ No newline at end of file
storage/storagefileiojstest/src/main/js/test/module_fileio/class_randomAccessFile/write.test.js
0 → 100644
浏览文件 @
6761a358
此差异已折叠。
点击以展开。
storage/storagefileiojstest/src/main/js/test/module_fileio/members/createRandomAccessFile.test.js
0 → 100644
浏览文件 @
6761a358
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录