meta_tests.cpp 1018 字节
Newer Older
X
Xu Peng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
////////////////////////////////////////////////////////////////////////////////
// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
// Unauthorized copying of this file, via any medium is strictly prohibited.
// Proprietary and confidential.
////////////////////////////////////////////////////////////////////////////////
#include <gtest/gtest.h>
#include <thread>
#include <easylogging++.h>

#include "utils.h"
#include "db/DBMetaImpl.h"
#include "db/Factories.h"

using namespace zilliz::vecwise::engine;

X
Xu Peng 已提交
16
TEST_F(MetaTest, GROUP_TEST) {
X
Xu Peng 已提交
17 18 19 20
    auto group_id = "meta_test_group";

    meta::GroupSchema group;
    group.group_id = group_id;
X
Xu Peng 已提交
21
    auto status = impl_->add_group(group);
X
Xu Peng 已提交
22 23
    ASSERT_TRUE(status.ok());

X
Xu Peng 已提交
24
    status = impl_->get_group(group);
X
Xu Peng 已提交
25 26 27
    ASSERT_TRUE(status.ok());

    group.group_id = "not_found";
X
Xu Peng 已提交
28
    status = impl_->get_group(group);
X
Xu Peng 已提交
29 30
    ASSERT_TRUE(!status.ok());

X
Xu Peng 已提交
31 32 33
    group.group_id = group_id;
    status = impl_->add_group(group);
    ASSERT_TRUE(!status.ok());
X
Xu Peng 已提交
34
}