提交 a973ad3f 编写于 作者: S Shengliang Guan

minor changes

上级 5d86becd
aux_source_directory(. VGROUP_SRC)
add_executable(dnode_test_vgroup ${VGROUP_SRC})
aux_source_directory(. VNODE_SRC)
add_executable(dnode_test_vnode ${VNODE_SRC})
target_link_libraries(
dnode_test_vgroup
dnode_test_vnode
PUBLIC sut
)
add_test(
NAME dnode_test_vgroup
COMMAND dnode_test_vgroup
NAME dnode_test_vnode
COMMAND dnode_test_vnode
)
......@@ -11,9 +11,9 @@
#include "sut.h"
class DndTestVgroup : public ::testing::Test {
class DndTestVnode : public ::testing::Test {
protected:
static void SetUpTestSuite() { test.Init("/tmp/dnode_test_vgroup", 9150); }
static void SetUpTestSuite() { test.Init("/tmp/dnode_test_vnode", 9150); }
static void TearDownTestSuite() { test.Cleanup(); }
static Testbase test;
......@@ -23,9 +23,9 @@ class DndTestVgroup : public ::testing::Test {
void TearDown() override {}
};
Testbase DndTestVgroup::test;
Testbase DndTestVnode::test;
TEST_F(DndTestVgroup, 01_Create_Restart_Drop_Vnode) {
TEST_F(DndTestVnode, 01_Create_Restart_Drop_Vnode) {
{
for (int i = 0; i < 3; ++i) {
int32_t contLen = sizeof(SCreateVnodeMsg);
......
aux_source_directory(. DB_SRC)
add_executable(dnode_test_db ${DB_SRC})
add_executable(mnode_test_db ${DB_SRC})
target_link_libraries(
dnode_test_db
mnode_test_db
PUBLIC sut
)
add_test(
NAME dnode_test_db
COMMAND dnode_test_db
NAME mnode_test_db
COMMAND mnode_test_db
)
/**
* @file db.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module db-msg tests
* @version 0.1
* @date 2021-12-15
* @brief MNODE module db tests
* @version 1.0
* @date 2022-01-11
*
* @copyright Copyright (c) 2021
* @copyright Copyright (c) 2022
*
*/
#include "sut.h"
class DndTestDb : public ::testing::Test {
class MndTestDb : public ::testing::Test {
protected:
static void SetUpTestSuite() { test.Init("/tmp/dnode_test_db", 9040); }
static void SetUpTestSuite() { test.Init("/tmp/mnode_test_db", 9030); }
static void TearDownTestSuite() { test.Cleanup(); }
static Testbase test;
......@@ -23,9 +23,9 @@ class DndTestDb : public ::testing::Test {
void TearDown() override {}
};
Testbase DndTestDb::test;
Testbase MndTestDb::test;
TEST_F(DndTestDb, 01_ShowDb) {
TEST_F(MndTestDb, 01_ShowDb) {
test.SendShowMetaReq(TSDB_MGMT_TABLE_DB, "");
CHECK_META("show databases", 18);
CHECK_SCHEMA(0, TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN - 1 + VARSTR_HEADER_SIZE, "name");
......@@ -51,7 +51,7 @@ TEST_F(DndTestDb, 01_ShowDb) {
EXPECT_EQ(test.GetShowRows(), 0);
}
TEST_F(DndTestDb, 02_Create_Alter_Drop_Db) {
TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
{
int32_t contLen = sizeof(SCreateDbMsg);
......@@ -211,7 +211,7 @@ TEST_F(DndTestDb, 02_Create_Alter_Drop_Db) {
EXPECT_EQ(test.GetShowRows(), 0);
}
TEST_F(DndTestDb, 03_Create_Use_Restart_Use_Db) {
TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
{
int32_t contLen = sizeof(SCreateDbMsg);
......@@ -281,7 +281,7 @@ TEST_F(DndTestDb, 03_Create_Use_Restart_Use_Db) {
EXPECT_EQ(pInfo->numOfEps, 1);
SEpAddrMsg* pAddr = &pInfo->epAddr[0];
pAddr->port = htons(pAddr->port);
EXPECT_EQ(pAddr->port, 9040);
EXPECT_EQ(pAddr->port, 9030);
EXPECT_STREQ(pAddr->fqdn, "localhost");
}
......@@ -297,7 +297,7 @@ TEST_F(DndTestDb, 03_Create_Use_Restart_Use_Db) {
EXPECT_EQ(pInfo->numOfEps, 1);
SEpAddrMsg* pAddr = &pInfo->epAddr[0];
pAddr->port = htons(pAddr->port);
EXPECT_EQ(pAddr->port, 9040);
EXPECT_EQ(pAddr->port, 9030);
EXPECT_STREQ(pAddr->fqdn, "localhost");
}
}
......
/**
* @file stb.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module db-msg tests
* @version 0.1
* @date 2021-12-17
* @brief MNODE module stb tests
* @version 1.0
* @date 2022-01-12
*
* @copyright Copyright (c) 2021
* @copyright Copyright (c) 2022
*
*/
#include "sut.h"
class DndTestStb : public ::testing::Test {
class MndTestStb : public ::testing::Test {
protected:
static void SetUpTestSuite() { test.Init("/tmp/dnode_test_stb", 9101); }
static void SetUpTestSuite() { test.Init("/tmp/mnode_test_stb", 9034); }
static void TearDownTestSuite() { test.Cleanup(); }
static Testbase test;
......@@ -23,9 +23,9 @@ class DndTestStb : public ::testing::Test {
void TearDown() override {}
};
Testbase DndTestStb::test;
Testbase MndTestStb::test;
TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
TEST_F(MndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
{
int32_t contLen = sizeof(SCreateDbMsg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册