From 2ab6fac489b10680166ba91d4d1ae6f680bd7ed4 Mon Sep 17 00:00:00 2001 From: "xianliang.li" Date: Tue, 15 Oct 2024 20:05:39 +0800 Subject: [PATCH] fix ut --- tests/ut/test_index_check.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/ut/test_index_check.cc b/tests/ut/test_index_check.cc index c821b63c3..c4b502ece 100644 --- a/tests/ut/test_index_check.cc +++ b/tests/ut/test_index_check.cc @@ -275,7 +275,10 @@ TEST_CASE("Test index feature check", "[IndexFeatureCheck]") { REQUIRE_FALSE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_RAFT_CAGRA, knowhere::feature::MMAP)); #endif -#ifdef KNOWHERE_WITH_DISKANN +#ifdef KNOWHERE_WITH_CARDINAL + REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_DISKANN, knowhere::feature::MMAP)); + REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_DISKANN, knowhere::feature::DISK)); +#elif REQUIRE_FALSE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_DISKANN, knowhere::feature::MMAP)); REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_DISKANN, knowhere::feature::DISK)); #endif @@ -344,13 +347,16 @@ TEST_CASE("Test index feature check", "[IndexFeatureCheck]") { REQUIRE_FALSE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_FAISS_BIN_IVFFLAT, knowhere::feature::SPARSE_FLOAT32)); - // HNSW Index REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_HNSW, knowhere::feature::FLOAT32)); REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_HNSW, knowhere::feature::FP16)); REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_HNSW, knowhere::feature::BF16)); REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_HNSW, knowhere::feature::BINARY)); + // HNSW Index +#ifdef KNOWHERE_WITH_CARDINAL + REQUIRE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_HNSW, knowhere::feature::SPARSE_FLOAT32)); +#else REQUIRE_FALSE(IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_HNSW, knowhere::feature::SPARSE_FLOAT32)); - +#endif // Sparse Indexes REQUIRE_FALSE( IndexFactory::Instance().FeatureCheck(IndexEnum::INDEX_SPARSE_INVERTED_INDEX, knowhere::feature::FLOAT32));