From c19a6ee483f4931a5bd5eb14fa7e0105609669f0 Mon Sep 17 00:00:00 2001 From: "xiaojun.lin" Date: Thu, 17 Oct 2019 16:31:02 +0800 Subject: [PATCH] MS-648 add ut v3 Former-commit-id: f9127c08e1bf0d2244fbed8113a003e52d781df4 --- core/src/index/unittest/Helper.h | 3 ++- .../src/index/unittest/test_customized_index.cpp | 16 +++++++++++++++- core/unittest/wrapper/test_hybrid_index.cpp | 4 ++-- core/unittest/wrapper/utils.cpp | 1 - core/unittest/wrapper/utils.h | 7 ------- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/core/src/index/unittest/Helper.h b/core/src/index/unittest/Helper.h index 6f043ce0e3..d11a484c03 100644 --- a/core/src/index/unittest/Helper.h +++ b/core/src/index/unittest/Helper.h @@ -16,6 +16,7 @@ // under the License. #include +#include #include "knowhere/index/vector_index/IndexGPUIVF.h" #include "knowhere/index/vector_index/IndexGPUIVFPQ.h" @@ -116,4 +117,4 @@ class TestGpuIndexBase : public ::testing::Test { TearDown() override { knowhere::FaissGpuResourceMgr::GetInstance().Free(); } -}; \ No newline at end of file +}; diff --git a/core/src/index/unittest/test_customized_index.cpp b/core/src/index/unittest/test_customized_index.cpp index 29809b6f3a..10b635043a 100644 --- a/core/src/index/unittest/test_customized_index.cpp +++ b/core/src/index/unittest/test_customized_index.cpp @@ -1,6 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at // -// Created by link on 2019/10/17. +// http://www.apache.org/licenses/LICENSE-2.0 // +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + #include #include "unittest/Helper.h" diff --git a/core/unittest/wrapper/test_hybrid_index.cpp b/core/unittest/wrapper/test_hybrid_index.cpp index cbd536d7af..757d5b2098 100644 --- a/core/unittest/wrapper/test_hybrid_index.cpp +++ b/core/unittest/wrapper/test_hybrid_index.cpp @@ -28,7 +28,7 @@ using ::testing::Values; using ::testing::Combine; class KnowhereHybrid - : public DataGenBase, public ::testing::Test { + : public DataGenBase, public ::testing::Test { protected: void SetUp() override { knowhere::FaissGpuResourceMgr::GetInstance().InitDevice(DEVICEID, PINMEM, TEMPMEM, RESNUM); @@ -38,7 +38,6 @@ class KnowhereHybrid nq = 100; k = 100; GenData(dim, nb, nq, xb, xq, ids, k, gt_ids, gt_dis); - } void TearDown() override { @@ -130,4 +129,5 @@ TEST_F(KnowhereHybrid, test_interface) { } } } + #endif diff --git a/core/unittest/wrapper/utils.cpp b/core/unittest/wrapper/utils.cpp index 7074823683..445b7a2de6 100644 --- a/core/unittest/wrapper/utils.cpp +++ b/core/unittest/wrapper/utils.cpp @@ -86,5 +86,4 @@ DataGenBase::AssertResult(const std::vector& ids, const std::vector gt_dis; }; -namespace { - -namespace ms = milvus::engine; -namespace kw = knowhere; - -} // namespace - class ParamGenerator { public: static ParamGenerator& GetInstance() {