🐞 fix(TSG-8143): 区分hos_open_fd的错误值以及fd的值,不再共用一个返回值

This commit is contained in:
pengxuanzheng
2021-10-22 18:02:23 +08:00
parent 88a8dccbd0
commit 400c33e92e
8 changed files with 55 additions and 32 deletions

View File

@@ -77,7 +77,8 @@ TEST(hos_close_fd, normal)
gtest_hos_handle_init(&expect_hos_handle, thread_num);
CheckStructGHosHandle(&g_hos_handle, &expect_hos_handle);
long fd = hos_open_fd(HOS_BUCKET, "object", NULL, NULL, 0);
size_t fd = 0;
int err = hos_open_fd(HOS_BUCKET, "object", NULL, NULL, 0, &fd);
CheckHosInstance(hos_instance, &expect_hos_instance);
CheckStructGHosHandle(&g_hos_handle, &expect_hos_handle);
gtest_hos_fd_init(&expect_fd_info);
@@ -121,7 +122,8 @@ TEST(hos_close_fd, paramer_error)
expect_hos_handle.hos_config.thread_num=2;
CheckStructGHosHandle(&g_hos_handle, &expect_hos_handle);
long fd = hos_open_fd(HOS_BUCKET, "object", NULL, NULL, 0);
size_t fd = 0;
int err = hos_open_fd(HOS_BUCKET, "object", NULL, NULL, 0, &fd);
CheckHosInstance(hos_instance, &expect_hos_instance);
CheckStructGHosHandle(&g_hos_handle, &expect_hos_handle);
gtest_hos_fd_init(&expect_fd_info);