提交 4bc0e507 编写于 作者: wmmhello's avatar wmmhello

modify test case

上级 f72c9837
...@@ -369,16 +369,17 @@ TEST(testCase, ordered_merge_sort_Test) { ...@@ -369,16 +369,17 @@ TEST(testCase, ordered_merge_sort_Test) {
tsortSetFetchRawDataFp(phandle, getSingleColDummyBlock); tsortSetFetchRawDataFp(phandle, getSingleColDummyBlock);
tsortSetComparFp(phandle, docomp); tsortSetComparFp(phandle, docomp);
SGenericSource* p = static_cast<SGenericSource*>(taosMemoryCalloc(10, sizeof(SGenericSource))); SGenericSource* p[10] = {0};
_info* c = static_cast<_info*>(taosMemoryCalloc(10, sizeof(_info))); _info c[10] = {0};
for(int32_t i = 0; i < 10; ++i) { for(int32_t i = 0; i < 10; ++i) {
p[i] = static_cast<SGenericSource*>(taosMemoryCalloc(1, sizeof(SGenericSource)));
c[i].count = 1; c[i].count = 1;
c[i].pageRows = 1000; c[i].pageRows = 1000;
c[i].startVal = i*1000; c[i].startVal = i*1000;
c[i].type = TSDB_DATA_TYPE_INT; c[i].type = TSDB_DATA_TYPE_INT;
p[i].param = c; p[i]->param = &c[i];
tsortAddSource(phandle, &p[i]); tsortAddSource(phandle, p[i]);
} }
int32_t code = tsortOpen(phandle); int32_t code = tsortOpen(phandle);
...@@ -395,8 +396,9 @@ TEST(testCase, ordered_merge_sort_Test) { ...@@ -395,8 +396,9 @@ TEST(testCase, ordered_merge_sort_Test) {
ASSERT_EQ(row++, *(int32_t*) v); ASSERT_EQ(row++, *(int32_t*) v);
} }
taosMemoryFree(p); for(int32_t i = 0; i < 10; ++i) {
taosMemoryFree(c); taosMemoryFree(p[i]);
}
tsortDestroySortHandle(phandle); tsortDestroySortHandle(phandle);
blockDataDestroy(pBlock); blockDataDestroy(pBlock);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册