summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/predicate
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-11-28 07:52:10 +0100
committerHenning Baldersheim <balder@oath.com>2018-11-28 09:30:07 +0100
commitb88e32a2e58febd84a6524552d88e49c9e06e4b0 (patch)
tree565ec7644b430603220e2d0d4dfe730148b61e8b /searchlib/src/tests/predicate
parent6ea5ec1c12a3e5591892ed25a8d71b089f91b0ec (diff)
Use explicit EntryRef constructor to avoid unintended conversion
Conflicts: searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp
Diffstat (limited to 'searchlib/src/tests/predicate')
-rw-r--r--searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp9
-rw-r--r--searchlib/src/tests/predicate/predicate_index_test.cpp10
-rw-r--r--searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp9
-rw-r--r--searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp14
-rw-r--r--searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp8
-rw-r--r--searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp10
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp6
7 files changed, 43 insertions, 23 deletions
diff --git a/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
index 7d621a2fa8f..368804b93d8 100644
--- a/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_bounds_posting_list_test.cpp
@@ -1,13 +1,16 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for predicate_bounds_posting_list.
-#include <vespa/log/log.h>
-LOG_SETUP("predicate_bounds_posting_list_test");
-
+#include <vespa/searchlib/predicate/predicate_index.h>
#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/searchlib/predicate/predicate_bounds_posting_list.h>
+#include <vespa/searchlib/btree/btreeroot.hpp>
+#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("predicate_bounds_posting_list_test");
+
using namespace search;
using namespace search::predicate;
diff --git a/searchlib/src/tests/predicate/predicate_index_test.cpp b/searchlib/src/tests/predicate/predicate_index_test.cpp
index fcc9995da4a..6d74e6c7343 100644
--- a/searchlib/src/tests/predicate/predicate_index_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_index_test.cpp
@@ -1,13 +1,17 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for predicate_index.
-#include <vespa/log/log.h>
-LOG_SETUP("predicate_index_test");
-
#include <vespa/searchlib/predicate/predicate_index.h>
+#include <vespa/searchlib/predicate/simple_index.hpp>
#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/attribute/predicate_attribute.h>
+#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/searchlib/btree/btreeroot.hpp>
+#include <vespa/searchlib/btree/btreeiterator.hpp>
+
+#include <vespa/log/log.h>
+LOG_SETUP("predicate_index_test");
using namespace search;
using namespace search::predicate;
diff --git a/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
index 16047e74e58..5b3f213b698 100644
--- a/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_interval_posting_list_test.cpp
@@ -1,13 +1,16 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for predicate_interval_posting_list.
-#include <vespa/log/log.h>
-LOG_SETUP("predicate_interval_posting_list_test");
-
+#include <vespa/searchlib/predicate/predicate_index.h>
#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/searchlib/predicate/predicate_interval_posting_list.h>
+#include <vespa/searchlib/btree/btreeroot.hpp>
+#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("predicate_interval_posting_list_test");
+
using namespace search;
using namespace search::predicate;
namespace {
diff --git a/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp b/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp
index 90763cb75ad..a72a441ba10 100644
--- a/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp
@@ -141,7 +141,7 @@ TEST("require that NOTs get correct intervals") {
EXPECT_EQUAL(2u, result.interval_map.size());
checkInterval(result, "key=value",
{0x00010001, 0x00020002, 0x00040004, 0x00050005});
- checkInterval(result, PredicateIndex::z_star_compressed_attribute_name,
+ checkInterval(result, Constants::z_star_compressed_attribute_name,
{0x00020001, 0x00050004});
}
@@ -156,7 +156,7 @@ TEST("require that NOT inverts ANDs and ORs") {
EXPECT_EQUAL(2u, result.interval_map.size());
checkInterval(result, "key=value",
{0x00010002, 0x00010003});
- checkInterval(result, PredicateIndex::z_star_compressed_attribute_name,
+ checkInterval(result, Constants::z_star_compressed_attribute_name,
{0x00020000});
}
@@ -168,7 +168,7 @@ TEST("require that final first NOT-interval is extended") {
EXPECT_EQUAL(2u, result.interval_range);
EXPECT_EQUAL(2u, result.interval_map.size());
checkInterval(result, "key=A", {0x00010001});
- checkInterval(result, PredicateIndex::z_star_compressed_attribute_name,
+ checkInterval(result, Constants::z_star_compressed_attribute_name,
{0x00010000});
}
@@ -188,7 +188,7 @@ TEST("show different types of NOT-intervals") {
checkInterval(result, "key=B", {0x00020002});
checkInterval(result, "key=C", {0x00010004});
checkInterval(result, "key=D", {0x00060006});
- checkInterval(result, PredicateIndex::z_star_compressed_attribute_name,
+ checkInterval(result, Constants::z_star_compressed_attribute_name,
{0x00020001, 0x00000006, 0x00040000});
slime = orNode({neg(featureSet("key", {"A"})),
@@ -200,7 +200,7 @@ TEST("show different types of NOT-intervals") {
EXPECT_EQUAL(3u, result.interval_map.size());
checkInterval(result, "key=A", {0x00010003});
checkInterval(result, "key=B", {0x00010003});
- checkInterval(result, PredicateIndex::z_star_compressed_attribute_name,
+ checkInterval(result, Constants::z_star_compressed_attribute_name,
{0x00030000, 0x00030000});
slime = orNode({andNode({neg(featureSet("key", {"A"})),
@@ -216,7 +216,7 @@ TEST("show different types of NOT-intervals") {
checkInterval(result, "key=B", {0x00030007});
checkInterval(result, "key=C", {0x00010005});
checkInterval(result, "key=D", {0x00070007});
- checkInterval(result, PredicateIndex::z_star_compressed_attribute_name,
+ checkInterval(result, Constants::z_star_compressed_attribute_name,
{0x00010000, 0x00070002, 0x00050000,
0x00070006});
@@ -333,7 +333,7 @@ TEST("require that z-star feature is only registered once") {
EXPECT_EQUAL(4u, result.interval_range);
ASSERT_EQUAL(3u, result.features.size());
EXPECT_EQUAL(PredicateHash::hash64("key1=value1"), result.features[0]);
- EXPECT_EQUAL(PredicateIndex::z_star_compressed_hash, result.features[1]);
+ EXPECT_EQUAL(Constants::z_star_compressed_hash, result.features[1]);
EXPECT_EQUAL(PredicateHash::hash64("key2=10-19"), result.features[2]);
ASSERT_EQUAL(0u, result.range_features.size());
}
diff --git a/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp
index 346c0f0f4b2..2d8f13a3a4c 100644
--- a/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_zero_constraint_posting_list_test.cpp
@@ -1,12 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for predicate_zero_constraint_posting_list.
-#include <vespa/log/log.h>
-LOG_SETUP("predicate_zero_constraint_posting_list_test");
-
#include <vespa/searchlib/predicate/predicate_zero_constraint_posting_list.h>
+#include <vespa/searchlib/predicate/predicate_index.h>
+
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("predicate_zero_constraint_posting_list_test");
+
using namespace search;
using namespace search::predicate;
diff --git a/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp b/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
index 6e65ec5a0d2..e20895b559f 100644
--- a/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_zstar_compressed_posting_list_test.cpp
@@ -1,13 +1,15 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for predicate_zstar_compressed_posting_list.
-#include <vespa/log/log.h>
-LOG_SETUP("predicate_zstar_compressed_posting_list_test");
-
-#include <vespa/searchlib/predicate/predicate_tree_annotator.h>
#include <vespa/searchlib/predicate/predicate_zstar_compressed_posting_list.h>
+#include <vespa/searchlib/predicate/predicate_index.h>
+#include <vespa/searchlib/btree/btreeroot.hpp>
+#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("predicate_zstar_compressed_posting_list_test");
+
using namespace search;
using namespace search::predicate;
using std::vector;
diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp
index fbb0a5933c9..928897f2134 100644
--- a/searchlib/src/tests/predicate/simple_index_test.cpp
+++ b/searchlib/src/tests/predicate/simple_index_test.cpp
@@ -4,6 +4,12 @@
#include <vespa/searchlib/predicate/simple_index.hpp>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/attribute/predicate_attribute.h>
+#include <vespa/searchlib/btree/btree.hpp>
+#include <vespa/searchlib/btree/btreeroot.hpp>
+#include <vespa/searchlib/btree/btreeiterator.hpp>
+#include <vespa/searchlib/btree/btreestore.hpp>
+#include <vespa/searchlib/btree/btreenodeallocator.hpp>
+#include <map>
#include <vespa/log/log.h>
LOG_SETUP("simple_index_test");