diff --git a/cpp/src/core/CMakeLists.txt b/cpp/src/core/CMakeLists.txt index f1a13b4520..9125f6ea2c 100644 --- a/cpp/src/core/CMakeLists.txt +++ b/cpp/src/core/CMakeLists.txt @@ -95,7 +95,7 @@ endif() set(CORE_INCLUDE_DIRS ${CORE_INCLUDE_DIRS} PARENT_SCOPE) if(BUILD_UNIT_TEST STREQUAL "ON") - add_subdirectory(test) + add_subdirectory(unittest) endif() config_summary() diff --git a/cpp/src/core/test/CMakeLists.txt b/cpp/src/core/unittest/CMakeLists.txt similarity index 98% rename from cpp/src/core/test/CMakeLists.txt rename to cpp/src/core/unittest/CMakeLists.txt index ecb52695bc..6b5775c2cd 100644 --- a/cpp/src/core/test/CMakeLists.txt +++ b/cpp/src/core/unittest/CMakeLists.txt @@ -30,7 +30,7 @@ set(util_srcs ${CORE_SOURCE_DIR}/knowhere/knowhere/adapter/ArrowAdapter.cpp ${CORE_SOURCE_DIR}/knowhere/knowhere/common/Exception.cpp ${CORE_SOURCE_DIR}/knowhere/knowhere/common/Timer.cpp - ${CORE_SOURCE_DIR}/test/utils.cpp + ${CORE_SOURCE_DIR}/unittest/utils.cpp ) # diff --git a/cpp/src/core/test/SPTAG.cpp b/cpp/src/core/unittest/SPTAG.cpp similarity index 100% rename from cpp/src/core/test/SPTAG.cpp rename to cpp/src/core/unittest/SPTAG.cpp diff --git a/cpp/src/core/test/faiss_ori/CMakeLists.txt b/cpp/src/core/unittest/faiss_ori/CMakeLists.txt similarity index 100% rename from cpp/src/core/test/faiss_ori/CMakeLists.txt rename to cpp/src/core/unittest/faiss_ori/CMakeLists.txt diff --git a/cpp/src/core/test/faiss_ori/gpuresource_test.cpp b/cpp/src/core/unittest/faiss_ori/gpuresource_test.cpp similarity index 100% rename from cpp/src/core/test/faiss_ori/gpuresource_test.cpp rename to cpp/src/core/unittest/faiss_ori/gpuresource_test.cpp diff --git a/cpp/src/core/test/kdtree.cpp b/cpp/src/core/unittest/kdtree.cpp similarity index 100% rename from cpp/src/core/test/kdtree.cpp rename to cpp/src/core/unittest/kdtree.cpp diff --git a/cpp/src/core/test/sift.50NN.graph b/cpp/src/core/unittest/sift.50NN.graph similarity index 100% rename from cpp/src/core/test/sift.50NN.graph rename to cpp/src/core/unittest/sift.50NN.graph diff --git a/cpp/src/core/test/siftsmall_base.fvecs b/cpp/src/core/unittest/siftsmall_base.fvecs similarity index 100% rename from cpp/src/core/test/siftsmall_base.fvecs rename to cpp/src/core/unittest/siftsmall_base.fvecs diff --git a/cpp/src/core/test/test_idmap.cpp b/cpp/src/core/unittest/test_idmap.cpp similarity index 99% rename from cpp/src/core/test/test_idmap.cpp rename to cpp/src/core/unittest/test_idmap.cpp index 8bf0d5c8d2..9ee4ea732d 100644 --- a/cpp/src/core/test/test_idmap.cpp +++ b/cpp/src/core/unittest/test_idmap.cpp @@ -23,7 +23,7 @@ #include "knowhere/index/vector_index/IndexIDMAP.h" #include "knowhere/index/vector_index/helpers/Cloner.h" -#include "test/utils.h" +#include "unittest/utils.h" namespace { diff --git a/cpp/src/core/test/test_ivf.cpp b/cpp/src/core/unittest/test_ivf.cpp similarity index 99% rename from cpp/src/core/test/test_ivf.cpp rename to cpp/src/core/unittest/test_ivf.cpp index 9835264bff..2aa6937dbe 100644 --- a/cpp/src/core/test/test_ivf.cpp +++ b/cpp/src/core/unittest/test_ivf.cpp @@ -35,7 +35,7 @@ #include "knowhere/index/vector_index/IndexIVFSQ.h" #include "knowhere/index/vector_index/helpers/Cloner.h" -#include "test/utils.h" +#include "unittest/utils.h" namespace { diff --git a/cpp/src/core/test/test_json.cpp b/cpp/src/core/unittest/test_json.cpp similarity index 100% rename from cpp/src/core/test/test_json.cpp rename to cpp/src/core/unittest/test_json.cpp diff --git a/cpp/src/core/test/test_kdt.cpp b/cpp/src/core/unittest/test_kdt.cpp similarity index 99% rename from cpp/src/core/test/test_kdt.cpp rename to cpp/src/core/unittest/test_kdt.cpp index 45809bf396..85c8650d1b 100644 --- a/cpp/src/core/test/test_kdt.cpp +++ b/cpp/src/core/unittest/test_kdt.cpp @@ -26,7 +26,7 @@ #include "knowhere/index/vector_index/IndexKDT.h" #include "knowhere/index/vector_index/helpers/Definitions.h" -#include "test/utils.h" +#include "unittest/utils.h" namespace { diff --git a/cpp/src/core/test/test_nsg.cpp b/cpp/src/core/unittest/test_nsg.cpp similarity index 100% rename from cpp/src/core/test/test_nsg.cpp rename to cpp/src/core/unittest/test_nsg.cpp diff --git a/cpp/src/core/test/test_nsg/CMakeLists.txt b/cpp/src/core/unittest/test_nsg/CMakeLists.txt similarity index 100% rename from cpp/src/core/test/test_nsg/CMakeLists.txt rename to cpp/src/core/unittest/test_nsg/CMakeLists.txt diff --git a/cpp/src/core/test/test_nsg/test_nsg.cpp b/cpp/src/core/unittest/test_nsg/test_nsg.cpp similarity index 99% rename from cpp/src/core/test/test_nsg/test_nsg.cpp rename to cpp/src/core/unittest/test_nsg/test_nsg.cpp index 6f7ca1eba9..b93a2ddc35 100644 --- a/cpp/src/core/test/test_nsg/test_nsg.cpp +++ b/cpp/src/core/unittest/test_nsg/test_nsg.cpp @@ -24,7 +24,7 @@ #include "knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h" #include "knowhere/index/vector_index/nsg/NSGIO.h" -#include "test/utils.h" +#include "unittest/utils.h" namespace { diff --git a/cpp/src/core/test/utils.cpp b/cpp/src/core/unittest/utils.cpp similarity index 99% rename from cpp/src/core/test/utils.cpp rename to cpp/src/core/unittest/utils.cpp index a921b69802..e81ad8ea02 100644 --- a/cpp/src/core/test/utils.cpp +++ b/cpp/src/core/unittest/utils.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "test/utils.h" +#include "unittest/utils.h" #include #include diff --git a/cpp/src/core/test/utils.h b/cpp/src/core/unittest/utils.h similarity index 100% rename from cpp/src/core/test/utils.h rename to cpp/src/core/unittest/utils.h diff --git a/cpp/src/wrapper/ConfAdapter.cpp b/cpp/src/wrapper/ConfAdapter.cpp index df1ac6bb70..09d219b999 100644 --- a/cpp/src/wrapper/ConfAdapter.cpp +++ b/cpp/src/wrapper/ConfAdapter.cpp @@ -81,7 +81,7 @@ IVFConfAdapter::MatchNlist(const int64_t& size, const int64_t& nlist) { // calculate a proper nlist if nlist not specified or size less than TYPICAL_COUNT return int(size / TYPICAL_COUNT * 16384); } - return 0; + return nlist; } knowhere::Config