summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-04-08 19:44:13 +0000
committerArne Juul <arnej@verizonmedia.com>2020-04-08 19:44:13 +0000
commit921203ba11357efeeeefcdf0f7cebeae2bc75092 (patch)
tree12f91a5f2faf99f273216ea73aa04c6a7443183d /searchlib
parent91e0020981c6ebfedf7db7f9975f780001d05cce (diff)
unit test links histogram better
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp8
1 files changed, 8 insertions, 0 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 72dd6bd6d53..7d38be7db4a 100644
--- a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
+++ b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
@@ -308,6 +308,10 @@ TEST_F(HnswIndexTest, 2d_vectors_inserted_in_hierarchic_graph_with_heuristic_sel
EXPECT_EQ(0, root["level_histogram"][0].asLong());
EXPECT_EQ(5, root["level_histogram"][1].asLong());
EXPECT_EQ(0, root["level_0_links_histogram"][0].asLong());
+ EXPECT_EQ(1, root["level_0_links_histogram"][1].asLong());
+ EXPECT_EQ(3, root["level_0_links_histogram"][2].asLong());
+ EXPECT_EQ(3, root["level_0_links_histogram"][3].asLong());
+ EXPECT_EQ(0, root["level_0_links_histogram"][4].asLong());
EXPECT_EQ(0, root["unreachable_nodes"].asLong());
}
@@ -333,6 +337,10 @@ TEST_F(HnswIndexTest, 2d_vectors_inserted_in_hierarchic_graph_with_heuristic_sel
EXPECT_EQ(0, root["level_histogram"][0].asLong());
EXPECT_EQ(4, root["level_histogram"][1].asLong());
EXPECT_EQ(0, root["level_0_links_histogram"][0].asLong());
+ EXPECT_EQ(1, root["level_0_links_histogram"][1].asLong());
+ EXPECT_EQ(4, root["level_0_links_histogram"][2].asLong());
+ EXPECT_EQ(1, root["level_0_links_histogram"][3].asLong());
+ EXPECT_EQ(0, root["level_0_links_histogram"][4].asLong());
EXPECT_EQ(0, root["unreachable_nodes"].asLong());
}
}