From 760dc57dcf49db908117980abe9f45ce72c268b1 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Mon, 26 Feb 2024 10:30:13 +0800 Subject: [PATCH] converage --- include/common/tmsg.h | 5 ++--- source/common/src/tmsg.c | 48 +++++++++++++++------------------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index fe53217eac..d2e256f844 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1324,14 +1324,13 @@ typedef struct { } SDnodeListReq; int32_t tSerializeSDnodeListReq(void* buf, int32_t bufLen, SDnodeListReq* pReq); -int32_t tDeserializeSDnodeListReq(void* buf, int32_t bufLen, SDnodeListReq* pReq); typedef struct { int32_t useless; // useless } SServerVerReq; int32_t tSerializeSServerVerReq(void* buf, int32_t bufLen, SServerVerReq* pReq); -int32_t tDeserializeSServerVerReq(void* buf, int32_t bufLen, SServerVerReq* pReq); +// int32_t tDeserializeSServerVerReq(void* buf, int32_t bufLen, SServerVerReq* pReq); typedef struct { char ver[TSDB_VERSION_LEN]; @@ -1907,7 +1906,7 @@ typedef struct { } SShowVariablesReq; int32_t tSerializeSShowVariablesReq(void* buf, int32_t bufLen, SShowVariablesReq* pReq); -int32_t tDeserializeSShowVariablesReq(void* buf, int32_t bufLen, SShowVariablesReq* pReq); +// int32_t tDeserializeSShowVariablesReq(void* buf, int32_t bufLen, SShowVariablesReq* pReq); typedef struct { char name[TSDB_CONFIG_OPTION_LEN + 1]; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 85f5d462c7..6addd36958 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3280,18 +3280,6 @@ int32_t tSerializeSDnodeListReq(void *buf, int32_t bufLen, SDnodeListReq *pReq) return tlen; } -int32_t tDeserializeSDnodeListReq(void *buf, int32_t bufLen, SDnodeListReq *pReq) { - SDecoder decoder = {0}; - tDecoderInit(&decoder, buf, bufLen); - - if (tStartDecode(&decoder) < 0) return -1; - if (tDecodeI32(&decoder, &pReq->rowNum) < 0) return -1; - tEndDecode(&decoder); - - tDecoderClear(&decoder); - return 0; -} - int32_t tSerializeSServerVerReq(void *buf, int32_t bufLen, SServerVerReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen); @@ -3305,17 +3293,17 @@ int32_t tSerializeSServerVerReq(void *buf, int32_t bufLen, SServerVerReq *pReq) return tlen; } -int32_t tDeserializeSServerVerReq(void *buf, int32_t bufLen, SServerVerReq *pReq) { - SDecoder decoder = {0}; - tDecoderInit(&decoder, buf, bufLen); +// int32_t tDeserializeSServerVerReq(void *buf, int32_t bufLen, SServerVerReq *pReq) { +// SDecoder decoder = {0}; +// tDecoderInit(&decoder, buf, bufLen); - if (tStartDecode(&decoder) < 0) return -1; - if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1; +// if (tStartDecode(&decoder) < 0) return -1; +// if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1; - tEndDecode(&decoder); - tDecoderClear(&decoder); - return 0; -} +// tEndDecode(&decoder); +// tDecoderClear(&decoder); +// return 0; +// } int32_t tSerializeSServerVerRsp(void *buf, int32_t bufLen, SServerVerRsp *pRsp) { SEncoder encoder = {0}; @@ -4233,17 +4221,17 @@ int32_t tSerializeSShowVariablesReq(void *buf, int32_t bufLen, SShowVariablesReq return tlen; } -int32_t tDeserializeSShowVariablesReq(void *buf, int32_t bufLen, SShowVariablesReq *pReq) { - SDecoder decoder = {0}; - tDecoderInit(&decoder, buf, bufLen); +// int32_t tDeserializeSShowVariablesReq(void *buf, int32_t bufLen, SShowVariablesReq *pReq) { +// SDecoder decoder = {0}; +// tDecoderInit(&decoder, buf, bufLen); - if (tStartDecode(&decoder) < 0) return -1; - if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1; +// if (tStartDecode(&decoder) < 0) return -1; +// if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1; - tEndDecode(&decoder); - tDecoderClear(&decoder); - return 0; -} +// tEndDecode(&decoder); +// tDecoderClear(&decoder); +// return 0; +// } int32_t tEncodeSVariablesInfo(SEncoder *pEncoder, SVariablesInfo *pInfo) { if (tEncodeCStr(pEncoder, pInfo->name) < 0) return -1;