增加hos_init_instance gtest用例

This commit is contained in:
彭宣正
2021-04-26 18:19:16 +08:00
parent 87537258b3
commit 56fea8c87f
3 changed files with 28 additions and 24 deletions

View File

@@ -0,0 +1,25 @@
/*************************************************************************
> File Name: gtest_hos_cleint_create.cpp
> Author: pxz
> Created Time: Tue 29 Sep 2020 10:20:49 AM CST
************************************************************************/
#include <aws/external/gtest.h>
#include "hos_client.h"
TEST(hos_init_instance, normal)
{
hos_instance hos_instance = hos_init_instance("../conf/default.conf", "hos_default_conf", 1, "hos_test_bucket");
EXPECT_EQ(hos_instance->result, true);
int ret = hos_shutdown_instance();
EXPECT_EQ(ret, HOS_CLIENT_OK);
}
TEST(hos_open_fd, buffer)
{
hos_instance hos_instance = hos_init_instance("../conf/default.conf", "hos_default_conf", 1, "hos_test_bucket");
EXPECT_EQ(hos_instance->result, true);
int fd = hos_open_fd("hos_test_bucket", "hos_test_object", NULL, NULL, 0, BUFF_MODE);
EXPECT_EQ(fd, 3);
int ret = hos_shutdown_instance();
EXPECT_EQ(ret, HOS_CLIENT_OK);
}