提交 f2376058 编写于 作者: G gsl_1234

modified the format of xts

Signed-off-by: Ngsl_1234 <gaoshunli@huawei.com>
上级 7349fae1
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// import fileIO from '@ohos.file.fs';
import {
fileio, fileIO, FILE_CONTENT, prepareFile, nextFileName, isIntNum,
describe, it, expect,
......@@ -184,7 +184,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0000
* @tc.name fileIO_test_read_async_000
* @tc.desc Test readAsync() interfaces.
* @tc.desc Test read() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -211,7 +211,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0010
* @tc.name fileIO_test_read_async_001
* @tc.desc Test readAsync() interfaces.
* @tc.desc Test read() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -239,7 +239,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0020
* @tc.name fileIO_test_read_async_002
* @tc.desc Test readAsync() interfaces.
* @tc.desc Test read() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -266,7 +266,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0030
* @tc.name fileIO_test_read_async_003
* @tc.desc Test readAsync() interfaces.
* @tc.desc Test read() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -295,7 +295,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0040
* @tc.name fileIO_test_read_async_004
* @tc.desc Test readAsync() interface.
* @tc.desc Test read() interface.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -324,7 +324,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0050
* @tc.name fileIO_test_read_async_005
* @tc.desc Test readAsync() interfaces.
* @tc.desc Test read() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -353,7 +353,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_READ_ASYNC_0060
* @tc.name fileIO_test_read_async_006
* @tc.desc Test readAsync() interfaces.
* @tc.desc Test read() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -369,6 +369,5 @@ import {
done();
}
});
});
}
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// import fileIO from '@ohos.file.fs';
import {
fileio, fileIO, FILE_CONTENT, prepareFile, nextFileName, isIntNum,
describe, it, expect,
......@@ -24,7 +24,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_ASYNC_0000
* @tc.name fileIO_truncate_async_000
* @tc.desc Test the truncateAsync() interface that receives the fpath parameter.
* @tc.desc Test the truncate() interface that receives the fpath parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -53,7 +53,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_ASYNC_0010
* @tc.name fileIO_truncate_async_001
* @tc.desc Test the truncateAsync() interface that receives the fd parameter.
* @tc.desc Test the truncate() interface that receives the fd parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -83,7 +83,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_ASYNC_0020
* @tc.name fileIO_truncate_async_002
* @tc.desc Test the truncateAsync() interface that receives the fpath parameter.
* @tc.desc Test the truncate() interface that receives the fpath parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -119,7 +119,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_ASYNC_0030
* @tc.name fileIO_truncate_async_003
* @tc.desc Test the truncateAsync() interface that receives the fd parameter.
* @tc.desc Test the truncate() interface that receives the fd parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -154,7 +154,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_ASYNC_0040
* @tc.name fileIO_truncate_async_004
* @tc.desc Test the truncateAsync() interface that receives the fpath parameter.
* @tc.desc Test the truncate() interface that receives the fpath parameter.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -200,7 +200,7 @@ import {
});
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0000
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0010
* @tc.name fileIO_test_truncate_sync_001
* @tc.desc Test the truncateSync() interface that receives the fd parameter.
* @tc.size MEDIUM
......@@ -228,7 +228,7 @@ import {
});
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0010
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0020
* @tc.name fileIO_test_truncate_sync_002
* @tc.desc Test the truncateSync() interface that receives the fpath parameter.
* @tc.size MEDIUM
......@@ -249,7 +249,7 @@ import {
});
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0010
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0030
* @tc.name fileIO_test_truncate_sync_003
* @tc.desc Test the truncateSync() interface that receives the fd parameter.
* @tc.size MEDIUM
......@@ -276,7 +276,7 @@ import {
});
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0020
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0040
* @tc.name fileIO_test_truncate_sync_004
* @tc.desc Test truncateSync() interfaces.
* @tc.size MEDIUM
......@@ -294,8 +294,8 @@ import {
});
/**
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0020
* @tc.name fileio_test_truncate_sync_v9_005
* @tc.number SUB_DF_FILEIO_TRUNCATE_SYNC_0050
* @tc.name fileio_test_truncate_sync_005
* @tc.desc Test truncateSync() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
......@@ -312,7 +312,6 @@ import {
expect(!!e).assertTrue();
}
});
});
}
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// import fileIO from '@ohos.file.fs';
import {
fileio, fileIO, FILE_CONTENT, nextFileName, isIntNum,
describe, it, expect,
......@@ -205,7 +205,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0000
* @tc.name fileIO_test_write_async_000
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -230,7 +230,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0010
* @tc.name fileIO_test_write_async_001
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -258,7 +258,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0020
* @tc.name fileIO_test_write_async_002
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -287,7 +287,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0030
* @tc.name fileIO_test_write_async_003
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -317,7 +317,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0040
* @tc.name fileIO_test_write_async_004
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -330,13 +330,14 @@ import {
let fd = fileio.openSync(fpath, 0o102, 0o664);
expect(isIntNum(fd)).assertTrue();
await fileIO.write(fd, new ArrayBuffer(4096), function (
error,
bytesWritten
error,
bytesWritten
) {
expect(bytesWritten == 4096).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
});
expect(bytesWritten == 4096).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
}
);
done();
} catch (e) {
console.log('fileIO_test_write_async_004 has failed for ' + e.message + ', code: ' + e.code);
......@@ -347,7 +348,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0050
* @tc.name fileIO_test_write_async_005
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -365,11 +366,11 @@ import {
{
length: 5,
}, function (error, bytesWritten) {
expect(bytesWritten == 5).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
expect(bytesWritten == 5).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
);
} catch (e) {
console.log('fileIO_test_write_async_005 has failed for ' + e.message + ', code: ' + e.code);
......@@ -380,7 +381,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0060
* @tc.name fileIO_test_write_async_006
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -399,11 +400,11 @@ import {
length: 5,
offset: 5,
}, function (error, bytesWritten) {
expect(bytesWritten == 5).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
expect(bytesWritten == 5).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
);
} catch (e) {
console.log('fileIO_test_write_async_006 has failed for ' + e.message + ', code: ' + e.code);
......@@ -414,7 +415,7 @@ import {
/**
* @tc.number SUB_DF_FILEIO_WRITE_ASYNC_0070
* @tc.name fileIO_test_write_async_007
* @tc.desc Test writeAsync() interfaces.
* @tc.desc Test write() interfaces.
* @tc.size MEDIUM
* @tc.type Functoin
* @tc.level Level 0
......@@ -434,18 +435,16 @@ import {
offset: 5,
encoding: 'utf-8',
}, function (error, bytesWritten) {
expect(bytesWritten == 5).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
expect(bytesWritten == 5).assertTrue();
expect(fileio.closeSync(fd) == null).assertTrue();
expect(fileio.unlinkSync(fpath) == null).assertTrue();
done();
}
);
} catch (e) {
console.log('fileIO_test_write_async_007 has failed for ' + e.message + ', code: ' + e.code);
expect(null).assertFail();
}
});
});
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册