fix: catalog unit test

This commit is contained in:
Xiaoyu Wang 2023-04-10 10:53:29 +08:00
parent e2f82f4423
commit 637bf33c51
1 changed files with 69 additions and 80 deletions

View File

@ -27,8 +27,8 @@
#ifdef WINDOWS
#define TD_USE_WINSOCK
#endif
#include "catalogInt.h"
#include "catalog.h"
#include "catalogInt.h"
#include "os.h"
#include "stub.h"
#include "taos.h"
@ -536,7 +536,6 @@ void ctgTestRspMultiSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRp
tFreeSTableMetaRsp(&metaRsp);
}
void ctgTestRspErrIndexInfo(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
rpcFreeCont(pMsg->pCont);
@ -545,7 +544,6 @@ void ctgTestRspErrIndexInfo(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMs
pRsp->pCont = NULL;
}
void ctgTestRspUserAuth(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
rpcFreeCont(pMsg->pCont);
@ -553,6 +551,7 @@ void ctgTestRspUserAuth(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *p
strcpy(userRsp.user, ctgTestUsername);
userRsp.version = 1;
userRsp.superAuth = 1;
userRsp.enable = 1;
int32_t contLen = tSerializeSGetUserAuthRsp(NULL, 0, &userRsp);
void *pReq = rpcMallocCont(contLen);
@ -727,8 +726,6 @@ void ctgTestRspDndeList(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *p
tFreeSDnodeListRsp(&dRsp);
}
void ctgTestRspAuto(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
switch (pMsg->msgType) {
case TDMT_MND_USE_DB:
@ -763,7 +760,6 @@ void ctgTestRspAuto(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp)
return;
}
void ctgTestRspByIdx(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
switch (ctgTestRspFunc[ctgTestRspIdx]) {
case CTGT_RSP_VGINFO:
@ -1204,7 +1200,6 @@ void *ctgTestSetCtableMetaThread(void *param) {
return NULL;
}
void ctgTestFetchRows(TAOS_RES *result, int32_t *rows) {
TAOS_ROW row;
int num_fields = taos_num_fields(result);
@ -1232,7 +1227,6 @@ void ctgTestExecQuery(TAOS * taos, char* sql, bool fetch, int32_t *rows) {
taos_free_result(result);
}
TEST(tableMeta, normalTable) {
struct SCatalog *pCtg = NULL;
SVgroupInfo vgInfo = {0};
@ -2045,7 +2039,6 @@ TEST(refreshGetMeta, normal2child) {
ctgTestCurrentSTableName = NULL;
}
TEST(refreshGetMeta, stable2child) {
struct SCatalog *pCtg = NULL;
SRequestConnInfo connInfo = {0};
@ -2973,7 +2966,6 @@ TEST(apiTest, catalogGetQnodeList_test) {
catalogDestroy();
}
TEST(apiTest, catalogGetUdfInfo_test) {
struct SCatalog *pCtg = NULL;
SRequestConnInfo connInfo = {0};
@ -3003,7 +2995,6 @@ TEST(apiTest, catalogGetUdfInfo_test) {
catalogDestroy();
}
TEST(apiTest, catalogGetServerVersion_test) {
struct SCatalog *pCtg = NULL;
SRequestConnInfo connInfo = {0};
@ -3065,7 +3056,6 @@ TEST(apiTest, catalogUpdateTableIndex_test) {
catalogDestroy();
}
TEST(apiTest, catalogGetDnodeList_test) {
struct SCatalog *pCtg = NULL;
SRequestConnInfo connInfo = {0};
@ -3149,7 +3139,6 @@ TEST(intTest, autoCreateTableTest) {
#endif
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();