Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
68ca5f52
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
68ca5f52
编写于
8月 07, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]fix memory leaks.
上级
39dc3c42
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
12 addition
and
1 deletion
+12
-1
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+1
-0
src/query/tests/CMakeLists.txt
src/query/tests/CMakeLists.txt
+1
-1
src/query/tests/tsBufTest.cpp
src/query/tests/tsBufTest.cpp
+10
-0
未找到文件。
src/query/src/qTsbuf.c
浏览文件 @
68ca5f52
...
@@ -72,6 +72,7 @@ STSBuf* tsBufCreateFromFile(const char* path, bool autoDelete) {
...
@@ -72,6 +72,7 @@ STSBuf* tsBufCreateFromFile(const char* path, bool autoDelete) {
// invalid file
// invalid file
if
(
header
.
magic
!=
TS_COMP_FILE_MAGIC
)
{
if
(
header
.
magic
!=
TS_COMP_FILE_MAGIC
)
{
tsBufDestroy
(
pTSBuf
);
return
NULL
;
return
NULL
;
}
}
...
...
src/query/tests/CMakeLists.txt
浏览文件 @
68ca5f52
...
@@ -10,6 +10,6 @@ IF (HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR)
...
@@ -10,6 +10,6 @@ IF (HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR)
INCLUDE_DIRECTORIES
(
${
HEADER_GTEST_INCLUDE_DIR
}
)
INCLUDE_DIRECTORIES
(
${
HEADER_GTEST_INCLUDE_DIR
}
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
queryTest
${
SOURCE_LIST
}
)
ADD_EXECUTABLE
(
queryTest
./unitTest.cpp ./tsBufTest.cpp
)
TARGET_LINK_LIBRARIES
(
queryTest taos query gtest pthread gcov
)
TARGET_LINK_LIBRARIES
(
queryTest taos query gtest pthread gcov
)
ENDIF
()
ENDIF
()
src/query/tests/tsBufTest.cpp
浏览文件 @
68ca5f52
...
@@ -47,6 +47,8 @@ void simpleTest() {
...
@@ -47,6 +47,8 @@ void simpleTest() {
EXPECT_EQ
(
pTSBuf
->
block
.
numOfElem
,
num
);
EXPECT_EQ
(
pTSBuf
->
block
.
numOfElem
,
num
);
tsBufDestroy
(
pTSBuf
);
tsBufDestroy
(
pTSBuf
);
free
(
list
);
}
}
// one large list of ts, the ts list need to be split into several small blocks
// one large list of ts, the ts list need to be split into several small blocks
...
@@ -71,6 +73,7 @@ void largeTSTest() {
...
@@ -71,6 +73,7 @@ void largeTSTest() {
EXPECT_EQ
(
pTSBuf
->
block
.
numOfElem
,
num
);
EXPECT_EQ
(
pTSBuf
->
block
.
numOfElem
,
num
);
tsBufDestroy
(
pTSBuf
);
tsBufDestroy
(
pTSBuf
);
free
(
list
);
}
}
void
multiTagsTest
()
{
void
multiTagsTest
()
{
...
@@ -208,6 +211,8 @@ void loadDataTest() {
...
@@ -208,6 +211,8 @@ void loadDataTest() {
int64_t
e
=
taosGetTimestampUs
();
int64_t
e
=
taosGetTimestampUs
();
printf
(
"end:%"
PRIu64
", elapsed:%"
PRIu64
", total obj:%d
\n
"
,
e
,
e
-
s
,
x
);
printf
(
"end:%"
PRIu64
", elapsed:%"
PRIu64
", total obj:%d
\n
"
,
e
,
e
-
s
,
x
);
tsBufDestroy
(
pTSBuf
);
tsBufDestroy
(
pNewBuf
);
}
}
void
randomIncTsTest
()
{}
void
randomIncTsTest
()
{}
...
@@ -338,6 +343,8 @@ void TSTraverse() {
...
@@ -338,6 +343,8 @@ void TSTraverse() {
}
}
}
}
}
}
tsBufDestroy
(
pTSBuf
);
}
}
void
performanceTest
()
{}
void
performanceTest
()
{}
...
@@ -352,9 +359,12 @@ void invalidFileTest() {
...
@@ -352,9 +359,12 @@ void invalidFileTest() {
STSBuf
*
pNewBuf
=
tsBufCreateFromFile
(
"/tmp/test"
,
true
);
STSBuf
*
pNewBuf
=
tsBufCreateFromFile
(
"/tmp/test"
,
true
);
EXPECT_TRUE
(
pNewBuf
==
NULL
);
EXPECT_TRUE
(
pNewBuf
==
NULL
);
tsBufDestroy
(
pNewBuf
);
pNewBuf
=
tsBufCreateFromFile
(
"/tmp/911"
,
true
);
pNewBuf
=
tsBufCreateFromFile
(
"/tmp/911"
,
true
);
EXPECT_TRUE
(
pNewBuf
==
NULL
);
EXPECT_TRUE
(
pNewBuf
==
NULL
);
tsBufDestroy
(
pNewBuf
);
}
}
void
mergeDiffVnodeBufferTest
()
{
void
mergeDiffVnodeBufferTest
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录