@@ -130,17 +130,17 @@ TYPED_TEST(HNSWTest, resizeNAlignIndex) {
130130 }
131131 // The size and the capacity should be equal.
132132 HNSWIndex<TEST_DATA_T, TEST_DIST_T> *hnswIndex = this ->CastToHNSW (index);
133- ASSERT_EQ (hnswIndex->getIndexCapacity (), VecSimIndex_IndexSize (index));
133+ ASSERT_EQ (hnswIndex->indexCapacity (), VecSimIndex_IndexSize (index));
134134 // The capacity shouldn't be changed.
135- ASSERT_EQ (hnswIndex->getIndexCapacity (), n);
135+ ASSERT_EQ (hnswIndex->indexCapacity (), n);
136136
137137 // Add another vector to exceed the initial capacity.
138138 GenerateAndAddVector<TEST_DATA_T>(index, dim, n);
139139
140140 // The capacity should be now aligned with the block size.
141141 // bs = 3, size = 11 -> capacity = 12
142142 // New capacity = initial capacity + blockSize - initial capacity % blockSize.
143- ASSERT_EQ (hnswIndex->getIndexCapacity (), n + bs - n % bs);
143+ ASSERT_EQ (hnswIndex->indexCapacity (), n + bs - n % bs);
144144 VecSimIndex_Free (index);
145145}
146146
@@ -164,7 +164,7 @@ TYPED_TEST(HNSWTest, resizeNAlignIndex_largeInitialCapacity) {
164164
165165 // The capacity shouldn't change, should remain n.
166166 HNSWIndex<TEST_DATA_T, TEST_DIST_T> *hnswIndex = this ->CastToHNSW (index);
167- ASSERT_EQ (hnswIndex->getIndexCapacity (), n);
167+ ASSERT_EQ (hnswIndex->indexCapacity (), n);
168168
169169 // Delete last vector, to get size % block_size == 0. size = 3
170170 VecSimIndex_DeleteVector (index, bs);
@@ -174,7 +174,7 @@ TYPED_TEST(HNSWTest, resizeNAlignIndex_largeInitialCapacity) {
174174
175175 // New capacity = initial capacity - block_size - number_of_vectors_to_align =
176176 // 10 - 3 - 10 % 3 (1) = 6
177- size_t curr_capacity = hnswIndex->getIndexCapacity ();
177+ size_t curr_capacity = hnswIndex->indexCapacity ();
178178 ASSERT_EQ (curr_capacity, n - bs - n % bs);
179179
180180 // Delete all the vectors to decrease capacity by another bs.
@@ -183,20 +183,20 @@ TYPED_TEST(HNSWTest, resizeNAlignIndex_largeInitialCapacity) {
183183 VecSimIndex_DeleteVector (index, i);
184184 ++i;
185185 }
186- ASSERT_EQ (hnswIndex->getIndexCapacity (), bs);
186+ ASSERT_EQ (hnswIndex->indexCapacity (), bs);
187187 // Add and delete a vector to achieve:
188188 // size % block_size == 0 && size + bs <= capacity(3).
189189 // the capacity should be resized to zero
190190 GenerateAndAddVector<TEST_DATA_T>(index, dim, 0 );
191191 VecSimIndex_DeleteVector (index, 0 );
192- ASSERT_EQ (hnswIndex->getIndexCapacity (), 0 );
192+ ASSERT_EQ (hnswIndex->indexCapacity (), 0 );
193193
194194 // Do it again. This time after adding a vector the capacity is increased by bs.
195195 // Upon deletion it will be resized to zero again.
196196 GenerateAndAddVector<TEST_DATA_T>(index, dim, 0 );
197- ASSERT_EQ (hnswIndex->getIndexCapacity (), bs);
197+ ASSERT_EQ (hnswIndex->indexCapacity (), bs);
198198 VecSimIndex_DeleteVector (index, 0 );
199- ASSERT_EQ (hnswIndex->getIndexCapacity (), 0 );
199+ ASSERT_EQ (hnswIndex->indexCapacity (), 0 );
200200
201201 VecSimIndex_Free (index);
202202}
@@ -221,14 +221,14 @@ TYPED_TEST(HNSWTest, resizeNAlignIndex_largerBlockSize) {
221221
222222 HNSWIndex<TEST_DATA_T, TEST_DIST_T> *hnswIndex = this ->CastToHNSW (index);
223223 // The capacity shouldn't change.
224- ASSERT_EQ (hnswIndex->getIndexCapacity (), n);
224+ ASSERT_EQ (hnswIndex->indexCapacity (), n);
225225
226226 // Size equals capacity.
227227 ASSERT_EQ (VecSimIndex_IndexSize (index), n);
228228
229229 // Add another vector - > the capacity is increased to a multiplication of block_size.
230230 GenerateAndAddVector<TEST_DATA_T>(index, dim, n);
231- ASSERT_EQ (hnswIndex->getIndexCapacity (), bs);
231+ ASSERT_EQ (hnswIndex->indexCapacity (), bs);
232232
233233 // Size increased by 1.
234234 ASSERT_EQ (VecSimIndex_IndexSize (index), n + 1 );
@@ -237,7 +237,7 @@ TYPED_TEST(HNSWTest, resizeNAlignIndex_largerBlockSize) {
237237 VecSimIndex_DeleteVector (index, 1 );
238238
239239 // The capacity should remain the same.
240- ASSERT_EQ (hnswIndex->getIndexCapacity (), bs);
240+ ASSERT_EQ (hnswIndex->indexCapacity (), bs);
241241
242242 VecSimIndex_Free (index);
243243}
@@ -266,7 +266,7 @@ TYPED_TEST(HNSWTest, emptyIndex) {
266266 // The capacity should change to be aligned with the block size.
267267
268268 HNSWIndex<TEST_DATA_T, TEST_DIST_T> *hnswIndex = this ->CastToHNSW (index);
269- size_t new_capacity = hnswIndex->getIndexCapacity ();
269+ size_t new_capacity = hnswIndex->indexCapacity ();
270270 ASSERT_EQ (new_capacity, n - n % bs - bs);
271271
272272 // Size equals 0.
@@ -275,7 +275,7 @@ TYPED_TEST(HNSWTest, emptyIndex) {
275275 // Try to remove it again.
276276 // The capacity should remain unchanged, as we are trying to delete a label that doesn't exist.
277277 VecSimIndex_DeleteVector (index, 1 );
278- ASSERT_EQ (hnswIndex->getIndexCapacity (), new_capacity);
278+ ASSERT_EQ (hnswIndex->indexCapacity (), new_capacity);
279279 // Nor the size.
280280 ASSERT_EQ (VecSimIndex_IndexSize (index), 0 );
281281
0 commit comments