diff --git a/cpp/src/core/CMakeLists.txt b/cpp/src/core/CMakeLists.txt index f1a13b452002847dea2898f599898db0d449cdb6..9125f6ea2c5fc2bdedd57533eaeaab341d047561 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 ecb52695bcb6e8336297918ba5059246b3e6b496..6b5775c2cdeef755af1709ef1767e9af5e932508 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 8bf0d5c8d2e7180aaeed779bfc24a58130ab34e3..9ee4ea732d7b919ce3b7aba262134a662a222132 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 9835264bffa3c7ce8d9e355df8d5a115f74d55e0..2aa6937dbe26af916011d4a6ab40c082d3fef4c2 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 45809bf39668e4b4f9627f6e32bd4b9f51624aaf..85c8650d1b3e4b9c5aa4209c2a3a9b938729b934 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 6f7ca1eba9a28859828cc29cac71a2d9fd021625..b93a2ddc355eeff4165c8f4eabd4faf4cf98616d 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 a921b698022157cc0e80b9df158ff4773d922f14..e81ad8ea0253cf7668203386acdf76a8e94958e9 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 df1ac6bb70cb894b9a384f4a7467dd9240cba9f1..09d219b99923e90ffef7836ee48142c714e0411a 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