From 8852beb2ccb5ce20996dfcb4c2e0dfdb59909fd7 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 16 Feb 2024 15:17:15 +0800 Subject: [PATCH] coverage: tsdbUtil.c --- source/dnode/vnode/src/tsdb/tsdbDataIter.c | 2 ++ source/dnode/vnode/src/tsdb/tsdbUtil.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbDataIter.c b/source/dnode/vnode/src/tsdb/tsdbDataIter.c index 8215c1ac29..e1e6bd5f1f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbDataIter.c +++ b/source/dnode/vnode/src/tsdb/tsdbDataIter.c @@ -16,6 +16,7 @@ #include "tsdb.h" #include "vnodeInt.h" +#ifdef BUILD_NO_CALL // STsdbDataIter2 /* open */ int32_t tsdbOpenDataFileDataIter(SDataFReader* pReader, STsdbDataIter2** ppIter) { @@ -451,6 +452,7 @@ int32_t tsdbDataIterNext2(STsdbDataIter2* pIter, STsdbFilterInfo* pFilterInfo) { return code; } } +#endif /* get */ diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 87917cd243..44621bf4e6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -29,6 +29,7 @@ void tMapDataClear(SMapData *pMapData) { pMapData->aOffset = NULL; } +#ifdef BUILD_NO_CALL int32_t tMapDataPutItem(SMapData *pMapData, void *pItem, int32_t (*tPutItemFn)(uint8_t *, void *)) { int32_t code = 0; int32_t offset = pMapData->nData; @@ -95,12 +96,14 @@ int32_t tMapDataSearch(SMapData *pMapData, void *pSearchItem, int32_t (*tGetItem _exit: return code; } +#endif void tMapDataGetItemByIdx(SMapData *pMapData, int32_t idx, void *pItem, int32_t (*tGetItemFn)(uint8_t *, void *)) { ASSERT(idx >= 0 && idx < pMapData->nItem); tGetItemFn(pMapData->pData + pMapData->aOffset[idx], pItem); } +#ifdef BUILD_NO_CALL int32_t tMapDataToArray(SMapData *pMapData, int32_t itemSize, int32_t (*tGetItemFn)(uint8_t *, void *), SArray **ppArray) { int32_t code = 0; @@ -140,6 +143,7 @@ int32_t tPutMapData(uint8_t *p, SMapData *pMapData) { return n; } +#endif int32_t tGetMapData(uint8_t *p, SMapData *pMapData) { int32_t n = 0; @@ -167,6 +171,7 @@ int32_t tGetMapData(uint8_t *p, SMapData *pMapData) { return n; } +#ifdef BUILD_NO_CALL // TABLEID ======================================================================= int32_t tTABLEIDCmprFn(const void *p1, const void *p2) { TABLEID *pId1 = (TABLEID *)p1; @@ -199,6 +204,7 @@ int32_t tPutBlockIdx(uint8_t *p, void *ph) { return n; } +#endif int32_t tGetBlockIdx(uint8_t *p, void *ph) { int32_t n = 0; @@ -212,6 +218,7 @@ int32_t tGetBlockIdx(uint8_t *p, void *ph) { return n; } +#ifdef BUILD_NO_CALL int32_t tCmprBlockIdx(void const *lhs, void const *rhs) { SBlockIdx *lBlockIdx = (SBlockIdx *)lhs; SBlockIdx *rBlockIdx = (SBlockIdx *)rhs; @@ -280,6 +287,7 @@ int32_t tPutDataBlk(uint8_t *p, void *ph) { return n; } +#endif int32_t tGetDataBlk(uint8_t *p, void *ph) { int32_t n = 0; @@ -310,6 +318,7 @@ int32_t tGetDataBlk(uint8_t *p, void *ph) { return n; } +#ifdef BUILD_NO_CALL int32_t tDataBlkCmprFn(const void *p1, const void *p2) { SDataBlk *pBlock1 = (SDataBlk *)p1; SDataBlk *pBlock2 = (SDataBlk *)p2; @@ -349,6 +358,7 @@ int32_t tPutSttBlk(uint8_t *p, void *ph) { return n; } +#endif int32_t tGetSttBlk(uint8_t *p, void *ph) { int32_t n = 0; @@ -438,6 +448,7 @@ int32_t tGetBlockCol(uint8_t *p, void *ph) { return n; } +#ifdef BUILD_NO_CALL int32_t tBlockColCmprFn(const void *p1, const void *p2) { if (((SBlockCol *)p1)->cid < ((SBlockCol *)p2)->cid) { return -1; @@ -479,6 +490,7 @@ int32_t tPutDelIdx(uint8_t *p, void *ph) { return n; } +#endif int32_t tGetDelIdx(uint8_t *p, void *ph) { SDelIdx *pDelIdx = (SDelIdx *)ph; @@ -492,6 +504,7 @@ int32_t tGetDelIdx(uint8_t *p, void *ph) { return n; } +#ifdef BUILD_NO_CALL // SDelData ====================================================== int32_t tPutDelData(uint8_t *p, void *ph) { SDelData *pDelData = (SDelData *)ph; @@ -503,6 +516,7 @@ int32_t tPutDelData(uint8_t *p, void *ph) { return n; } +#endif int32_t tGetDelData(uint8_t *p, void *ph) { SDelData *pDelData = (SDelData *)ph; @@ -1269,6 +1283,7 @@ _exit: return code; } +#ifdef BUILD_NO_CALL int32_t tBlockDataTryUpsertRow(SBlockData *pBlockData, TSDBROW *pRow, int64_t uid) { if (pBlockData->nRow == 0) { return 1; @@ -1286,6 +1301,7 @@ int32_t tBlockDataUpsertRow(SBlockData *pBlockData, TSDBROW *pRow, STSchema *pTS return tBlockDataAppendRow(pBlockData, pRow, pTSchema, uid); } } +#endif void tBlockDataGetColData(SBlockData *pBlockData, int16_t cid, SColData **ppColData) { ASSERT(cid != PRIMARYKEY_TIMESTAMP_COL_ID);