update tests/adapter/unittest/softbus_file_test.cpp.

Signed-off-by: 王瑞峰 <wangruifeng14@huawei.com>
This commit is contained in:
王瑞峰 2024-08-30 01:45:31 +00:00 committed by Gitee
parent 36c9b78347
commit 24c93a4970
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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);
}
}