Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a235b282
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看板
提交
a235b282
编写于
7月 13, 2023
作者:
H
hu0475
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改storage子系统fs模块的代码
Signed-off-by:
N
hu0475
<
huyanqiang5@huawei.com
>
上级
420efaa4
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
17 addition
and
42 deletion
+17
-42
storage/crossplatform/storagefsetstest/src/main/ets/test/Common.ets
...ossplatform/storagefsetstest/src/main/ets/test/Common.ets
+0
-0
storage/crossplatform/storagefsetstest/src/main/ets/test/members/close.test.ets
...storagefsetstest/src/main/ets/test/members/close.test.ets
+4
-4
storage/crossplatform/storagefsetstest/src/main/ets/test/members/fsync.test.ets
...storagefsetstest/src/main/ets/test/members/fsync.test.ets
+9
-9
storage/crossplatform/storagefsetstest/src/main/ets/test/members/mkdir.test.ets
...storagefsetstest/src/main/ets/test/members/mkdir.test.ets
+1
-1
storage/crossplatform/storagefsetstest/src/main/ets/test/members/open.test.ets
.../storagefsetstest/src/main/ets/test/members/open.test.ets
+2
-27
storage/crossplatform/storagefsetstest/src/main/ets/test/members/stat.test.ets
.../storagefsetstest/src/main/ets/test/members/stat.test.ets
+1
-1
未找到文件。
storage/crossplatform/storagefsetstest/src/main/ets/test/Common.
j
s
→
storage/crossplatform/storagefsetstest/src/main/ets/test/Common.
et
s
浏览文件 @
a235b282
文件已移动
storage/crossplatform/storagefsetstest/src/main/ets/test/members/close.test.ets
浏览文件 @
a235b282
...
...
@@ -125,22 +125,22 @@ export default function fileIOClose() {
* @tc.type : Function
* @tc.level : Level 2
*/
it("fileIO_test_close_async_00
3
", 2, async function (done) {
let fpath = await nextFileName("fileIO_test_close_async_00
3
");
it("fileIO_test_close_async_00
4
", 2, async function (done) {
let fpath = await nextFileName("fileIO_test_close_async_00
4
");
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.READ_WRITE);
fileIO.close(file.fd, (err) => {
if (err) {
console.log("fileIO_test_close_async_00
3
error package: " + JSON.stringify(err));
console.log("fileIO_test_close_async_00
4
error package: " + JSON.stringify(err));
expect(false).assertTrue();
}
fileIO.unlinkSync(fpath);
done();
});
} catch (e) {
console.log("fileIO_test_close_async_00
3
has failed for " + e.message + ", code: " + e.code);
console.log("fileIO_test_close_async_00
4
has failed for " + e.message + ", code: " + e.code);
expect(false).assertTrue();
}
});
...
...
storage/crossplatform/storagefsetstest/src/main/ets/test/members/fsync.test.ets
浏览文件 @
a235b282
...
...
@@ -27,7 +27,7 @@ export default function fileIOFsync() {
* @tc.type : Function
* @tc.level : Level 2
*/
it("fileIO_test_fsync_async_000",
0
, async function (done) {
it("fileIO_test_fsync_async_000",
2
, async function (done) {
let fpath = await nextFileName("fileIO_test_fsync_async_000");
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
...
...
@@ -50,9 +50,9 @@ export default function fileIOFsync() {
* Invalid fd parameter.
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level
2
* @tc.level : Level
3
*/
it("fileIO_test_fsync_async_001",
0
, async function (done) {
it("fileIO_test_fsync_async_001",
3
, async function (done) {
try {
await fileIO.fsync(-1);
expect(false).assertTrue();
...
...
@@ -72,7 +72,7 @@ export default function fileIOFsync() {
* @tc.type : Function
* @tc.level : Level 2
*/
it("fileIO_test_fsync_async_002",
0
, async function (done) {
it("fileIO_test_fsync_async_002",
2
, async function (done) {
let fpath = await nextFileName("fileIO_test_fsync_async_002");
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
...
...
@@ -100,9 +100,9 @@ export default function fileIOFsync() {
* Invalid fd parameter.
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level
2
* @tc.level : Level
3
*/
it("fileIO_test_fsync_async_003",
0
, async function (done) {
it("fileIO_test_fsync_async_003",
3
, async function (done) {
try {
fileIO.fsync(-1, (err) => {
if (err) {
...
...
@@ -179,7 +179,7 @@ export default function fileIOFsync() {
* @tc.type : Function
* @tc.level : Level 2
*/
it("fileIO_test_fsync_sync_000",
0
, async function () {
it("fileIO_test_fsync_sync_000",
2
, async function () {
let fpath = await nextFileName("fileIO_test_fsync_sync_000");
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
...
...
@@ -201,9 +201,9 @@ export default function fileIOFsync() {
* Invalid fd parameter.
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level
2
* @tc.level : Level
3
*/
it("fileIO_test_fsync_sync_001",
0
, function () {
it("fileIO_test_fsync_sync_001",
3
, function () {
try {
fileIO.fsyncSync(-1);
expect(false).assertTrue();
...
...
storage/crossplatform/storagefsetstest/src/main/ets/test/members/mkdir.test.ets
浏览文件 @
a235b282
...
...
@@ -56,7 +56,7 @@ export default function fileIOMkdir() {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
await fileIO.mkdir
Sync
(fpath);
await fileIO.mkdir(fpath);
expect(false).assertTrue();
} catch (e) {
console.log("fileIO_test_mkdir_async_001 has failed for " + e.message + ", code: " + e.code);
...
...
storage/crossplatform/storagefsetstest/src/main/ets/test/members/open.test.ets
浏览文件 @
a235b282
...
...
@@ -30,9 +30,9 @@ export default function fileIOOpen() {
it("fileIO_test_open_async_000", 2, async function (done) {
let fpath = await nextFileName("fileIO_test_open_async_000");
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
let file = await fileIO.open(fpath, fileIO.OpenMode.READ_ONLY);
try {
let file = await fileIO.open(fpath, fileIO.OpenMode.READ_ONLY);
expect(isIntNum(file.fd)).assertTrue();
fileIO.read(file.fd, new ArrayBuffer(4096)).then((readLen) => {
expect(readLen == FILE_CONTENT.length).assertTrue();
...
...
@@ -40,6 +40,7 @@ export default function fileIOOpen() {
fileIO.writeSync(file.fd, new ArrayBuffer(4096));
expect(false).assertTrue();
} catch (e) {
fileIO.closeSync(file)
fileIO.unlinkSync(fpath);
console.log("fileIO_test_open_async_000 has failed for " + e.message + ", code: " + e.code);
expect(e.code == 13900008 && e.message == "Bad file descriptor").assertTrue();
...
...
@@ -1024,32 +1025,6 @@ export default function fileIOOpen() {
}
});
// /**
// * @tc.number : TEST_FILEIO_OPEN_SYNC_011
// * @tc.name : testFileIoOpenSync011
// * @tc.desc : Test openSync() interfaces. mode=0o400002.
// * The path points to a symbolic link, throw error.
// * @tc.size : MediumTest
// * @tc.type : Function
// * @tc.level : Level 2
// */
// it('testFileIoOpenSync011', 0, async function () {
// let fpath = await nextFileName('testFileIoOpenSync011');
// let ffpath = fpath + 'aaaa';
// expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
// try {
// fileIO.symlinkSync(fpath, ffpath);
// fileIO.openSync(ffpath, fileIO.OpenMode.NOFOLLOW | fileIO.OpenMode.READ_WRITE);
// expect(false).assertTrue();
// } catch (e) {
// fileIO.unlinkSync(fpath);
// // fileIO.unlinkSync(ffpath);
// console.log('testFileIoOpenSync011 has failed for ' + e.message + ', code: ' + e.code);
// expect(e.code == 13900033 && e.message == 'Too many symbolic links encountered').assertTrue();
// }
// });
/**
* @tc.number : SUB_FM_TEST_FILEFS_OPEN_SYNC_1000
* @tc.name : fileIO_test_open_sync_010
...
...
storage/crossplatform/storagefsetstest/src/main/ets/test/members/stat.test.ets
浏览文件 @
a235b282
/*
* 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');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录