mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-27 02:40:40 +00:00
update tests/adapter/unittest/softbus_file_test.cpp.
Signed-off-by: 王瑞峰 <wangruifeng14@huawei.com>
This commit is contained in:
parent
36c9b78347
commit
24c93a4970
@ -105,11 +105,11 @@ HWTEST_F(AdaptorDsoftbusFileTest, SoftBusPreadFileTest001, TestSize.Level1)
|
||||
fd = SoftBusOpenFile("/dev/urandom", SOFTBUS_O_RDONLY);
|
||||
EXPECT_NE(SOFTBUS_INVALID_FD, fd);
|
||||
ret = SoftBusPreadFile(fd, NULL, readBytes, offset);
|
||||
EXPECT_EQ(SOFTBUS_ERR, ret);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
ret = SoftBusPreadFile(fd, &value, readBytes, offset);
|
||||
EXPECT_NE(SOFTBUS_ERR, ret);
|
||||
EXPECT_NE(SOFTBUS_INVALID_PARAM, ret);
|
||||
ret = SoftBusPwriteFile(fd, NULL, readBytes, offset);
|
||||
EXPECT_EQ(SOFTBUS_ERR, ret);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
SoftBusCloseFile(fd);
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ HWTEST_F(AdaptorDsoftbusFileTest, SoftBusPreadFileTest001, TestSize.Level1)
|
||||
HWTEST_F(AdaptorDsoftbusFileTest, SoftBusMakeDirTest001, TestSize.Level1)
|
||||
{
|
||||
int32_t ret = SoftBusMakeDir(NULL, DEFAULT_NEW_PATH_AUTHORITY);
|
||||
EXPECT_EQ(SOFTBUS_ERR, ret);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -135,10 +135,10 @@ HWTEST_F(AdaptorDsoftbusFileTest, SoftBusGetFileSize001, TestSize.Level1)
|
||||
{
|
||||
uint64_t fileSize = 0;
|
||||
int32_t ret = SoftBusGetFileSize(NULL, &fileSize);
|
||||
EXPECT_EQ(SOFTBUS_ERR, ret);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
ret = SoftBusGetFileSize("/data", &fileSize);
|
||||
EXPECT_EQ(SOFTBUS_OK, ret);
|
||||
ret = SoftBusGetFileSize("/dev/test", &fileSize);
|
||||
EXPECT_EQ(SOFTBUS_ERR, ret);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user