Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
4eedfc40
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4eedfc40
编写于
3月 05, 2020
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add more code
上级
a04663b7
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
71 addition
and
39 deletion
+71
-39
src/vnode/CMakeLists.txt
src/vnode/CMakeLists.txt
+1
-1
src/vnode/tests/CMakeLists.txt
src/vnode/tests/CMakeLists.txt
+0
-3
src/vnode/tests/common/CMakeLists.txt
src/vnode/tests/common/CMakeLists.txt
+0
-14
src/vnode/tests/common/commonDataTests.cpp
src/vnode/tests/common/commonDataTests.cpp
+0
-7
src/vnode/tests/common/commonSChemaTests.cpp
src/vnode/tests/common/commonSChemaTests.cpp
+0
-9
src/vnode/tsdb/CMakeLists.txt
src/vnode/tsdb/CMakeLists.txt
+3
-1
src/vnode/tsdb/inc/tsdbMeta.h
src/vnode/tsdb/inc/tsdbMeta.h
+1
-0
src/vnode/tsdb/src/tsdbMeta.c
src/vnode/tsdb/src/tsdbMeta.c
+1
-2
src/vnode/tsdb/tests/CMakeLists.txt
src/vnode/tsdb/tests/CMakeLists.txt
+0
-2
src/vnode/tsdb/tests/tsdbTests.cpp
src/vnode/tsdb/tests/tsdbTests.cpp
+65
-0
未找到文件。
src/vnode/CMakeLists.txt
浏览文件 @
4eedfc40
...
...
@@ -6,4 +6,4 @@ add_subdirectory(tsdb)
enable_testing
()
add_subdirectory
(
tests
)
\ No newline at end of file
# add_subdirectory(tests)
\ No newline at end of file
src/vnode/tests/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
a04663b7
add_subdirectory
(
common
)
add_subdirectory
(
tsdb
)
\ No newline at end of file
src/vnode/tests/common/CMakeLists.txt
已删除
100644 → 0
浏览文件 @
a04663b7
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
message
(
STATUS
"COMMON:
${
SOURCE_LIST
}
"
)
add_executable
(
commonTests
${
SOURCE_LIST
}
)
target_link_libraries
(
commonTests gtest gtest_main pthread common
)
add_test
(
NAME
unit
COMMAND
${
CMAKE_CURRENT_BINARY_DIR
}
/commonTests
)
\ No newline at end of file
src/vnode/tests/common/commonDataTests.cpp
已删除
100644 → 0
浏览文件 @
a04663b7
#include <gtest/gtest.h>
#include "dataformat.h"
TEST
(
commonDataTests
,
createDataRow
)
{
EXPECT_EQ
(
1
,
2
/
2
);
}
\ No newline at end of file
src/vnode/tests/common/commonSChemaTests.cpp
已删除
100644 → 0
浏览文件 @
a04663b7
#include <gtest/gtest.h>
#include <stdlib.h>
#include <stdio.h>
#include "schema.h"
TEST
(
commonSchemaTests
,
createSchema
)
{
EXPECT_EQ
(
1
,
2
/
2
);
}
\ No newline at end of file
src/vnode/tsdb/CMakeLists.txt
浏览文件 @
4eedfc40
...
...
@@ -8,4 +8,6 @@ target_include_directories(tsdb
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/src/inc"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/src/util/inc"
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/src/os/linux/inc"
)
\ No newline at end of file
)
add_subdirectory
(
tests
)
\ No newline at end of file
src/vnode/tsdb/inc/tsdbMeta.h
浏览文件 @
4eedfc40
...
...
@@ -116,6 +116,7 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg);
int32_t
tsdbDropTableImpl
(
STsdbMeta
*
pMeta
,
STableId
tableId
);
STable
*
tsdbIsValidTableToInsert
(
STsdbMeta
*
pMeta
,
STableId
tableId
);
int32_t
tsdbInsertRowToTableImpl
(
SSkipListNode
*
pNode
,
STable
*
pTable
);
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
);
#ifdef __cplusplus
}
...
...
src/vnode/tsdb/src/tsdbMeta.c
浏览文件 @
4eedfc40
...
...
@@ -12,7 +12,6 @@
static
int
tsdbFreeTable
(
STable
*
pTable
);
static
int32_t
tsdbCheckTableCfg
(
STableCfg
*
pCfg
);
static
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
);
static
int
tsdbAddTableToMeta
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
static
int
tsdbAddTableIntoMap
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
static
int
tsdbAddTableIntoIndex
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
...
...
@@ -206,7 +205,7 @@ static int32_t tsdbCheckTableCfg(STableCfg *pCfg) {
return
0
;
}
static
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
)
{
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
)
{
return
(
STable
*
)
taosGetDataFromHashTable
(
pMeta
->
tableMap
,
(
char
*
)(
&
uid
),
sizeof
(
uid
));
}
...
...
src/vnode/t
ests/tsdb
/CMakeLists.txt
→
src/vnode/t
sdb/tests
/CMakeLists.txt
浏览文件 @
4eedfc40
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
message
(
STATUS
"TSDB:
${
SOURCE_LIST
}
"
)
add_executable
(
tsdbTests
${
SOURCE_LIST
}
)
target_link_libraries
(
tsdbTests gtest gtest_main pthread tsdb
)
...
...
src/vnode/t
ests/tsdb
/tsdbTests.cpp
→
src/vnode/t
sdb/tests
/tsdbTests.cpp
浏览文件 @
4eedfc40
#include <gtest/gtest.h>
#include <stdlib.h>
#include "tsdb.h"
#include "tsdb
Meta
.h"
TEST
(
TsdbTest
,
createTsdbRepo
)
{
TEST
(
TsdbTest
,
createTable
)
{
STsdbMeta
*
pMeta
=
tsdbCreateMeta
(
100
);
ASSERT_NE
(
pMeta
,
nullptr
);
STableCfg
config
;
config
.
tableId
.
tid
=
0
;
config
.
tableId
.
uid
=
98868728187539L
;
config
.
numOfCols
=
2
;
config
.
schema
=
(
SSchema
*
)
malloc
(
sizeof
(
SSchema
)
+
sizeof
(
SColumn
)
*
config
.
numOfCols
);
config
.
schema
->
version
=
0
;
config
.
schema
->
numOfCols
=
2
;
config
.
schema
->
numOfTags
=
0
;
config
.
schema
->
colIdCounter
=
1
;
for
(
int
i
=
0
;
i
<
config
.
numOfCols
;
i
++
)
{
SColumn
*
pCol
=
config
.
schema
->
columns
+
i
;
pCol
->
type
=
TD_DATATYPE_BIGINT
;
pCol
->
colId
=
config
.
schema
->
colIdCounter
++
;
pCol
->
offset
=
10
;
pCol
->
colName
=
strdup
(
"col1"
);
}
config
.
tagValues
=
nullptr
;
tsdbCreateTableImpl
(
pMeta
,
&
config
),
0
;
STable
*
pTable
=
tsdbGetTableByUid
(
pMeta
,
config
.
tableId
.
uid
);
ASSERT_NE
(
pTable
,
nullptr
);
}
TEST
(
TsdbTest
,
DISABLED_createTsdbRepo
)
{
STsdbCfg
*
pCfg
=
tsdbCreateDefaultCfg
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录