feat(TSG-7599): 修改测试用例

This commit is contained in:
“pengxuanzheng”
2021-09-06 15:26:20 +08:00
committed by pengxuanzheng
parent 8c49f4d2c2
commit 89a92df45a
15 changed files with 148 additions and 119 deletions

View File

@@ -43,7 +43,7 @@ static void gtest_hos_handle_init(hos_client_handle_t *hos_handle, int thread_nu
static void gtest_hos_instance_init(hos_instance instance)
{
memset(instance, 0, sizeof(hos_instance_s));
instance->result = true;
instance->status = INSTANCE_ENABLE_STATE;
instance->error_code = 0;
instance->error_message[0] ='\0';
instance->hos_url_prefix = "http://127.0.0.1:9098/hos/";
@@ -71,7 +71,7 @@ TEST(hos_close_fd, normal)
hos_fd_context_t expect_fd_info;
int thread_num = 2;
hos_instance hos_instance = hos_init_instance(HOS_CONF, "hos_default_conf", thread_num, HOS_BUCKET);
hos_instance hos_instance = hos_init_instance(HOS_CONF, "hos_default_conf", thread_num);
gtest_hos_instance_init(&expect_hos_instance);
CheckHosInstance(hos_instance, &expect_hos_instance);
gtest_hos_handle_init(&expect_hos_handle, thread_num);
@@ -90,7 +90,7 @@ TEST(hos_close_fd, normal)
ret = hos_shutdown_instance();
EXPECT_EQ(ret, HOS_CLIENT_OK);
expect_hos_instance.result = 0;
expect_hos_instance.status = INSTANCE_UNINIT_STATE;
expect_hos_instance.hos_url_prefix = NULL;
CheckHosInstance(hos_instance, &expect_hos_instance);
@@ -114,7 +114,7 @@ TEST(hos_close_fd, paramer_error)
hos_fd_context_t expect_fd_info;
int thread_num = 2;
hos_instance hos_instance = hos_init_instance(HOS_CONF, "hos_default_conf", thread_num, HOS_BUCKET);
hos_instance hos_instance = hos_init_instance(HOS_CONF, "hos_default_conf", thread_num);
gtest_hos_instance_init(&expect_hos_instance);
CheckHosInstance(hos_instance, &expect_hos_instance);
gtest_hos_handle_init(&expect_hos_handle, thread_num);
@@ -133,7 +133,7 @@ TEST(hos_close_fd, paramer_error)
ret = hos_shutdown_instance();
EXPECT_EQ(ret, HOS_CLIENT_OK);
expect_hos_instance.result = 0;
expect_hos_instance.status = INSTANCE_UNINIT_STATE;
expect_hos_instance.hos_url_prefix = NULL;
CheckHosInstance(hos_instance, &expect_hos_instance);
@@ -164,7 +164,7 @@ TEST(hos_close_fd, fd_not_exits)
hos_fd_context_t expect_fd_info;
int thread_num = 2;
hos_instance hos_instance = hos_init_instance(HOS_CONF, "hos_default_conf", thread_num, HOS_BUCKET);
hos_instance hos_instance = hos_init_instance(HOS_CONF, "hos_default_conf", thread_num);
gtest_hos_instance_init(&expect_hos_instance);
CheckHosInstance(hos_instance, &expect_hos_instance);
gtest_hos_handle_init(&expect_hos_handle, thread_num);
@@ -177,7 +177,7 @@ TEST(hos_close_fd, fd_not_exits)
ret = hos_shutdown_instance();
EXPECT_EQ(ret, HOS_CLIENT_OK);
expect_hos_instance.result = 0;
expect_hos_instance.status = INSTANCE_UNINIT_STATE;
expect_hos_instance.hos_url_prefix = NULL;
CheckHosInstance(hos_instance, &expect_hos_instance);
@@ -193,4 +193,4 @@ TEST(hos_close_fd, fd_not_exits)
memset(&expect_hos_handle, 0, sizeof(hos_client_handle_s));
CheckStructGHosHandle(&g_hos_handle, &expect_hos_handle);
}
#endif
#endif