@@ -425,7 +425,7 @@ TEST(FaissQueryBinaryIndexTest, BasicAssertions) {
425
425
knn_jni::faiss_wrapper::QueryBinaryIndex_WithFilter (
426
426
&mockJNIUtil, jniEnv,
427
427
reinterpret_cast <jlong>(&createdIndexWithData),
428
- reinterpret_cast <jbyteArray>(&query), k, nullptr , 0 , nullptr )));
428
+ reinterpret_cast <jbyteArray>(&query), k, nullptr , nullptr , 0 , nullptr )));
429
429
430
430
ASSERT_EQ (k, results->size ());
431
431
@@ -556,6 +556,10 @@ TEST(FaissQueryIndexWithParentFilterTest, BasicAssertions) {
556
556
// Setup jni
557
557
JNIEnv *jniEnv = nullptr ;
558
558
NiceMock<test_util::MockJNIUtil> mockJNIUtil;
559
+ EXPECT_CALL (mockJNIUtil,
560
+ GetJavaIntArrayLength (
561
+ jniEnv, reinterpret_cast <jintArray>(&parentIds)))
562
+ .WillRepeatedly (Return (parentIds.size ()));
559
563
for (auto query : queries) {
560
564
std::unique_ptr<std::vector<std::pair<int , float > *>> results (
561
565
reinterpret_cast <std::vector<std::pair<int , float > *> *>(
@@ -635,13 +639,13 @@ TEST(FaissCreateHnswSQfp16IndexTest, BasicAssertions) {
635
639
// Define the data
636
640
faiss::idx_t numIds = 200 ;
637
641
std::vector<faiss::idx_t > ids;
638
- auto *vectors = new std::vector<float >() ;
642
+ std::vector<float > vectors ;
639
643
int dim = 2 ;
640
- vectors-> reserve (dim * numIds);
644
+ vectors. reserve (dim * numIds);
641
645
for (int64_t i = 0 ; i < numIds; ++i) {
642
646
ids.push_back (i);
643
647
for (int j = 0 ; j < dim; ++j) {
644
- vectors-> push_back (test_util::RandomFloat (-500.0 , 500.0 ));
648
+ vectors. push_back (test_util::RandomFloat (-500.0 , 500.0 ));
645
649
}
646
650
}
647
651
@@ -660,14 +664,14 @@ TEST(FaissCreateHnswSQfp16IndexTest, BasicAssertions) {
660
664
EXPECT_CALL (mockJNIUtil,
661
665
GetJavaObjectArrayLength (
662
666
jniEnv, reinterpret_cast <jobjectArray>(&vectors)))
663
- .WillRepeatedly (Return (vectors-> size ()));
667
+ .WillRepeatedly (Return (vectors. size ()));
664
668
665
669
// Create the index
666
670
std::unique_ptr<FaissMethods> faissMethods (new FaissMethods ());
667
671
knn_jni::faiss_wrapper::IndexService IndexService (std::move (faissMethods));
668
672
knn_jni::faiss_wrapper::CreateIndex (
669
673
&mockJNIUtil, jniEnv, reinterpret_cast <jintArray>(&ids),
670
- (jlong)vectors, dim, (jstring)&indexPath,
674
+ (jlong)& vectors, dim, (jstring)&indexPath,
671
675
(jobject)¶metersMap, &IndexService);
672
676
673
677
// Make sure index can be loaded
0 commit comments