Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
7e00f351
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,发现更多精彩内容 >>
提交
7e00f351
编写于
4月 26, 2019
作者:
X
Xu Peng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(db): change log format for unittest
Former-commit-id: a364d3800fbefbd9287df906b5e69f4ec89d1aa7
上级
5fbe3d96
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
6 deletion
+19
-6
cpp/unittest/db/db_tests.cpp
cpp/unittest/db/db_tests.cpp
+19
-6
未找到文件。
cpp/unittest/db/db_tests.cpp
浏览文件 @
7e00f351
...
@@ -15,6 +15,18 @@
...
@@ -15,6 +15,18 @@
using
namespace
zilliz
::
vecwise
;
using
namespace
zilliz
::
vecwise
;
class
DBTest
:
public
::
testing
::
Test
{
protected:
virtual
void
SetUp
()
{
el
::
Configurations
defaultConf
;
defaultConf
.
setToDefault
();
defaultConf
.
set
(
el
::
Level
::
Debug
,
el
::
ConfigurationType
::
Format
,
"[%thread-%datetime-%level]: %msg (%fbase:%line)"
);
el
::
Loggers
::
reconfigureLogger
(
"default"
,
defaultConf
);
}
};
namespace
{
namespace
{
void
ASSERT_STATS
(
engine
::
Status
&
stat
)
{
void
ASSERT_STATS
(
engine
::
Status
&
stat
)
{
ASSERT_TRUE
(
stat
.
ok
());
ASSERT_TRUE
(
stat
.
ok
());
...
@@ -24,7 +36,8 @@ namespace {
...
@@ -24,7 +36,8 @@ namespace {
}
}
}
}
TEST
(
DBTest
,
DB_TEST
)
{
TEST_F
(
DBTest
,
DB_TEST
)
{
static
const
std
::
string
group_name
=
"test_group"
;
static
const
std
::
string
group_name
=
"test_group"
;
static
const
int
group_dim
=
256
;
static
const
int
group_dim
=
256
;
...
@@ -52,7 +65,7 @@ TEST(DBTest, DB_TEST) {
...
@@ -52,7 +65,7 @@ TEST(DBTest, DB_TEST) {
engine
::
IDNumbers
target_ids
;
engine
::
IDNumbers
target_ids
;
int
d
=
256
;
int
d
=
256
;
int
nb
=
2
;
int
nb
=
10
;
float
*
xb
=
new
float
[
d
*
nb
];
float
*
xb
=
new
float
[
d
*
nb
];
for
(
int
i
=
0
;
i
<
nb
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nb
;
i
++
)
{
for
(
int
j
=
0
;
j
<
d
;
j
++
)
xb
[
d
*
i
+
j
]
=
drand48
();
for
(
int
j
=
0
;
j
<
d
;
j
++
)
xb
[
d
*
i
+
j
]
=
drand48
();
...
@@ -66,7 +79,7 @@ TEST(DBTest, DB_TEST) {
...
@@ -66,7 +79,7 @@ TEST(DBTest, DB_TEST) {
qxb
[
d
*
i
]
+=
i
/
2000.
;
qxb
[
d
*
i
]
+=
i
/
2000.
;
}
}
int
loop
=
10
00000
;
int
loop
=
5
00000
;
for
(
auto
i
=
0
;
i
<
loop
;
++
i
)
{
for
(
auto
i
=
0
;
i
<
loop
;
++
i
)
{
if
(
i
==
40
)
{
if
(
i
==
40
)
{
...
@@ -98,9 +111,9 @@ TEST(DBTest, DB_TEST) {
...
@@ -98,9 +111,9 @@ TEST(DBTest, DB_TEST) {
engine
::
DB
::
Open
(
opt
,
&
db
);
engine
::
DB
::
Open
(
opt
,
&
db
);
db
->
drop_all
();
db
->
drop_all
();
delete
db
;
delete
db
;
}
}
;
TEST
(
SearchTest
,
DB
_TEST
)
{
TEST
_F
(
DBTest
,
SEARCH
_TEST
)
{
static
const
std
::
string
group_name
=
"test_group"
;
static
const
std
::
string
group_name
=
"test_group"
;
static
const
int
group_dim
=
256
;
static
const
int
group_dim
=
256
;
...
@@ -181,4 +194,4 @@ TEST(SearchTest, DB_TEST) {
...
@@ -181,4 +194,4 @@ TEST(SearchTest, DB_TEST) {
engine
::
DB
::
Open
(
opt
,
&
db
);
engine
::
DB
::
Open
(
opt
,
&
db
);
db
->
drop_all
();
db
->
drop_all
();
delete
db
;
delete
db
;
}
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录