Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
a365dfda
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a365dfda
编写于
6月 30, 2019
作者:
Z
zhiru
浏览文件
操作
浏览文件
下载
差异文件
update
Former-commit-id: 89a7dcabb06aff4efa21c59e6b3e1ded897f2f53
上级
e39a5226
64f01e2c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
1 deletion
+38
-1
cpp/unittest/db/meta_tests.cpp
cpp/unittest/db/meta_tests.cpp
+4
-1
cpp/unittest/db/misc_test.cpp
cpp/unittest/db/misc_test.cpp
+34
-0
未找到文件。
cpp/unittest/db/meta_tests.cpp
浏览文件 @
a365dfda
...
@@ -265,5 +265,8 @@ TEST_F(MetaTest, TABLE_FILES_TEST) {
...
@@ -265,5 +265,8 @@ TEST_F(MetaTest, TABLE_FILES_TEST) {
ASSERT_EQ
(
dated_files
[
table_file
.
date_
].
size
(),
ASSERT_EQ
(
dated_files
[
table_file
.
date_
].
size
(),
to_index_files_cnt
+
raw_files_cnt
+
index_files_cnt
);
to_index_files_cnt
+
raw_files_cnt
+
index_files_cnt
);
status
=
impl_
->
FilesToSearch
(
table_id
,
meta
::
DatesT
(),
dated_files
);
ASSERT_TRUE
(
status
.
ok
());
ASSERT_EQ
(
dated_files
[
table_file
.
date_
].
size
(),
to_index_files_cnt
+
raw_files_cnt
+
index_files_cnt
);
}
}
cpp/unittest/db/misc_test.cpp
浏览文件 @
a365dfda
...
@@ -13,11 +13,19 @@
...
@@ -13,11 +13,19 @@
#include "db/Status.h"
#include "db/Status.h"
#include "db/Options.h"
#include "db/Options.h"
#include "db/DBMetaImpl.h"
#include "db/DBMetaImpl.h"
#include "db/EngineFactory.h"
#include <vector>
#include <vector>
using
namespace
zilliz
::
milvus
;
using
namespace
zilliz
::
milvus
;
namespace
{
void
CopyStatus
(
engine
::
Status
&
st1
,
engine
::
Status
&
st2
)
{
st1
=
st2
;
}
}
TEST
(
DBMiscTest
,
ENGINE_API_TEST
)
{
TEST
(
DBMiscTest
,
ENGINE_API_TEST
)
{
//engine api AddWithIdArray
//engine api AddWithIdArray
const
uint16_t
dim
=
512
;
const
uint16_t
dim
=
512
;
...
@@ -34,6 +42,15 @@ TEST(DBMiscTest, ENGINE_API_TEST) {
...
@@ -34,6 +42,15 @@ TEST(DBMiscTest, ENGINE_API_TEST) {
auto
status
=
engine
.
AddWithIdArray
(
vectors
,
ids
);
auto
status
=
engine
.
AddWithIdArray
(
vectors
,
ids
);
ASSERT_TRUE
(
status
.
ok
());
ASSERT_TRUE
(
status
.
ok
());
auto
engine_ptr
=
engine
::
EngineFactory
::
Build
(
128
,
"/tmp"
,
engine
::
EngineType
::
INVALID
);
ASSERT_EQ
(
engine_ptr
,
nullptr
);
engine_ptr
=
engine
::
EngineFactory
::
Build
(
128
,
"/tmp"
,
engine
::
EngineType
::
FAISS_IVFFLAT
);
ASSERT_NE
(
engine_ptr
,
nullptr
);
engine_ptr
=
engine
::
EngineFactory
::
Build
(
128
,
"/tmp"
,
engine
::
EngineType
::
FAISS_IDMAP
);
ASSERT_NE
(
engine_ptr
,
nullptr
);
}
}
TEST
(
DBMiscTest
,
EXCEPTION_TEST
)
{
TEST
(
DBMiscTest
,
EXCEPTION_TEST
)
{
...
@@ -65,6 +82,10 @@ TEST(DBMiscTest, STATUS_TEST) {
...
@@ -65,6 +82,10 @@ TEST(DBMiscTest, STATUS_TEST) {
ASSERT_TRUE
(
status
.
IsDBTransactionError
());
ASSERT_TRUE
(
status
.
IsDBTransactionError
());
str
=
status
.
ToString
();
str
=
status
.
ToString
();
ASSERT_FALSE
(
str
.
empty
());
ASSERT_FALSE
(
str
.
empty
());
engine
::
Status
status_copy
=
engine
::
Status
::
OK
();
CopyStatus
(
status_copy
,
status
);
ASSERT_TRUE
(
status
.
IsDBTransactionError
());
}
}
TEST
(
DBMiscTest
,
OPTIONS_TEST
)
{
TEST
(
DBMiscTest
,
OPTIONS_TEST
)
{
...
@@ -88,6 +109,19 @@ TEST(DBMiscTest, OPTIONS_TEST) {
...
@@ -88,6 +109,19 @@ TEST(DBMiscTest, OPTIONS_TEST) {
engine
::
ArchiveConf
archive
(
"delete"
,
"1:2:3"
);
engine
::
ArchiveConf
archive
(
"delete"
,
"1:2:3"
);
ASSERT_TRUE
(
archive
.
GetCriterias
().
empty
());
ASSERT_TRUE
(
archive
.
GetCriterias
().
empty
());
}
}
{
engine
::
ArchiveConf
archive
(
"delete"
);
engine
::
ArchiveConf
::
CriteriaT
criterial
=
{
{
"disk"
,
1024
},
{
"days"
,
100
}
};
archive
.
SetCriterias
(
criterial
);
auto
crit
=
archive
.
GetCriterias
();
ASSERT_EQ
(
criterial
[
"disk"
],
1024
);
ASSERT_EQ
(
criterial
[
"days"
],
100
);
}
}
}
TEST
(
DBMiscTest
,
META_TEST
)
{
TEST
(
DBMiscTest
,
META_TEST
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录