diff options
Diffstat (limited to 'searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp')
-rw-r--r-- | searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp index c01fc33767a..b697effeab4 100644 --- a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp +++ b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp @@ -62,14 +62,14 @@ public: _vectors[docid] = vec; return *this; } - vespalib::eval::TypedCells get_vector(uint32_t docid, uint32_t subspace) const override { + vespalib::eval::TypedCells get_vector(uint32_t docid, uint32_t subspace) const noexcept override { return get_vectors(docid).cells(subspace); } - VectorBundle get_vectors(uint32_t docid) const override { + VectorBundle get_vectors(uint32_t docid) const noexcept override { ArrayRef ref(_vectors[docid]); assert((ref.size() % _subspace_type.size()) == 0); uint32_t subspaces = ref.size() / _subspace_type.size(); - return VectorBundle(ref.data(), subspaces, _subspace_type); + return {ref.data(), subspaces, _subspace_type}; } void clear() { _vectors.clear(); } @@ -106,7 +106,7 @@ public: .set(7, {3, 5}).set(8, {0, 3}).set(9, {4, 5}); } - ~HnswIndexTest() override {} + ~HnswIndexTest() override; auto dff() { return search::tensor::make_distance_function_factory( @@ -280,6 +280,9 @@ public: static constexpr bool is_single = std::is_same_v<IndexType, HnswIndex<HnswIndexType::SINGLE>>; }; +template <typename IndexType> +HnswIndexTest<IndexType>::~HnswIndexTest() = default; + using HnswIndexTestTypes = ::testing::Types<HnswIndex<HnswIndexType::SINGLE>, HnswIndex<HnswIndexType::MULTI>>; TYPED_TEST_SUITE(HnswIndexTest, HnswIndexTestTypes); |