提交 4c846895 编写于 作者: wafwerar's avatar wafwerar

test: add test time count print

上级 d5ab6209
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
if(NOT TD_WINDOWS)
add_test(
NAME dbTest
COMMAND dbTest
)
endif(NOT TD_WINDOWS)
add_test(
NAME dbTest
COMMAND dbTest
)
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
# if(NOT TD_WINDOWS)
add_test(
NAME funcTest
COMMAND funcTest
)
# endif(NOT TD_WINDOWS)
add_test(
NAME funcTest
COMMAND funcTest
)
\ No newline at end of file
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
# if(NOT TD_WINDOWS)
add_test(
NAME profileTest
COMMAND profileTest
)
# endif(NOT TD_WINDOWS)
add_test(
NAME profileTest
COMMAND profileTest
)
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
# if(NOT TD_WINDOWS)
add_test(
NAME showTest
COMMAND showTest
)
# endif(NOT TD_WINDOWS)
add_test(
NAME showTest
COMMAND showTest
)
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
if(NOT TD_WINDOWS)
add_test(
NAME smaTest
COMMAND smaTest
)
endif(NOT TD_WINDOWS)
add_test(
NAME smaTest
COMMAND smaTest
)
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
if(NOT TD_WINDOWS)
add_test(
NAME stbTest
COMMAND stbTest
)
endif(NOT TD_WINDOWS)
\ No newline at end of file
add_test(
NAME stbTest
COMMAND stbTest
)
\ No newline at end of file
......@@ -5,9 +5,7 @@ target_link_libraries(
PUBLIC sut
)
if(NOT TD_WINDOWS)
add_test(
NAME userTest
COMMAND userTest
)
endif(NOT TD_WINDOWS)
add_test(
NAME userTest
COMMAND userTest
)
......@@ -26,6 +26,7 @@
typedef struct SBlockKeyTuple {
TSKEY skey;
void* payloadAddr;
int16_t index;
} SBlockKeyTuple;
typedef struct SBlockKeyInfo {
......@@ -36,7 +37,6 @@ typedef struct SBlockKeyInfo {
static int32_t rowDataCompar(const void* lhs, const void* rhs) {
TSKEY left = *(TSKEY*)lhs;
TSKEY right = *(TSKEY*)rhs;
if (left == right) {
return 0;
} else {
......@@ -44,6 +44,16 @@ static int32_t rowDataCompar(const void* lhs, const void* rhs) {
}
}
static int32_t rowDataComparStable(const void* lhs, const void* rhs) {
TSKEY left = *(TSKEY*)lhs;
TSKEY right = *(TSKEY*)rhs;
if (left == right) {
return ((SBlockKeyTuple*)lhs)->index - ((SBlockKeyTuple*)rhs)->index;
} else {
return left > right ? 1 : -1;
}
}
void setBoundColumnInfo(SParsedDataColInfo* pColList, SSchema* pSchema, col_id_t numOfCols) {
pColList->numOfCols = numOfCols;
pColList->numOfBound = numOfCols;
......@@ -343,6 +353,7 @@ int sortRemoveDataBlockDupRows(STableDataBlocks* dataBuf, SBlockKeyInfo* pBlkKey
while (n < nRows) {
pBlkKeyTuple->skey = TD_ROW_KEY((STSRow*)pBlockData);
pBlkKeyTuple->payloadAddr = pBlockData;
pBlkKeyTuple->index = n;
// next loop
pBlockData += extendedRowSize;
......@@ -354,7 +365,7 @@ int sortRemoveDataBlockDupRows(STableDataBlocks* dataBuf, SBlockKeyInfo* pBlkKey
pBlkKeyTuple = pBlkKeyInfo->pKeyTuple;
// todo. qsort is unstable, if timestamp is same, should get the last one
qsort(pBlkKeyTuple, nRows, sizeof(SBlockKeyTuple), rowDataCompar);
qsort(pBlkKeyTuple, nRows, sizeof(SBlockKeyTuple), rowDataComparStable);
pBlkKeyTuple = pBlkKeyInfo->pKeyTuple;
int32_t i = 0;
......
......@@ -32,9 +32,7 @@ if(${BUILD_WINGETOPT})
target_link_libraries(plannerTest PUBLIC wingetopt)
endif()
# if(NOT TD_WINDOWS)
add_test(
NAME plannerTest
COMMAND plannerTest
)
# endif(NOT TD_WINDOWS)
add_test(
NAME plannerTest
COMMAND plannerTest
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册