summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-02-15 16:05:22 +0100
committerTor Egge <Tor.Egge@online.no>2022-02-15 16:05:22 +0100
commitbbd39ad17baa58613f9046b849b9402ea40e5a7b (patch)
treee180190ca8c5f9906614b20fbf73ed0ec85b73a8 /searchlib/src/tests
parent1e527535a2610b28c9218c636c9902379caccf32 (diff)
Propagate memory allocator to growable bitvector in SingleBoolAttribute.
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r--searchlib/src/tests/aggregator/perdocexpr.cpp2
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp8
-rw-r--r--searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp2
-rw-r--r--searchlib/src/tests/queryeval/queryeval.cpp2
4 files changed, 10 insertions, 4 deletions
diff --git a/searchlib/src/tests/aggregator/perdocexpr.cpp b/searchlib/src/tests/aggregator/perdocexpr.cpp
index e0071e28428..291114ffa90 100644
--- a/searchlib/src/tests/aggregator/perdocexpr.cpp
+++ b/searchlib/src/tests/aggregator/perdocexpr.cpp
@@ -1605,7 +1605,7 @@ AttributeGuard createInt8Attribute() {
}
AttributeGuard createBoolAttribute() {
- SingleBoolAttribute *selectAttr1(new SingleBoolAttribute("selectAttr1", search::GrowStrategy()));
+ SingleBoolAttribute *selectAttr1(new SingleBoolAttribute("selectAttr1", search::GrowStrategy(), false));
DocId docId(0);
selectAttr1->addDoc(docId);
selectAttr1->setBit(docId, true);
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index d7d0bfd4012..73dd7d2f776 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -2292,10 +2292,13 @@ AttributeTest::test_paged_attribute(const vespalib::string& name, const vespalib
lid_mapping_size = 17000;
sv_maxlid = 1500;
}
+ if (cfg.basicType() == search::attribute::BasicType::Type::BOOL) {
+ lid_mapping_size = rounded_size * 8 + 100;
+ }
LOG(info, "test_paged_attribute '%s'", name.c_str());
auto av = createAttribute(name, cfg);
auto v = std::dynamic_pointer_cast<IntegerAttribute>(av);
- ASSERT_TRUE(v);
+ ASSERT_TRUE(v || (!cfg.collectionType().isMultiValue() && !cfg.fastSearch()));
auto size1 = stat_size(swapfile);
// Grow mapping from lid to value or multivalue index
addClearedDocs(av, lid_mapping_size);
@@ -2355,6 +2358,9 @@ AttributeTest::test_paged_attributes()
cfg4.setPaged(true);
cfg4.setFastSearch(true);
EXPECT_EQUAL(7, test_paged_attribute("fs-int-mv-paged", basedir + "/3.fs-int-mv-paged/swapfile", cfg4));
+ search::attribute::Config cfg5(BasicType::BOOL, CollectionType::SINGLE);
+ cfg5.setPaged(true);
+ EXPECT_EQUAL(1, test_paged_attribute("std-bool-sv-paged", basedir + "/4.std-bool-sv-paged/swapfile", cfg5));
vespalib::alloc::MmapFileAllocatorFactory::instance().setup("");
vespalib::rmdir(basedir, true);
}
diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
index de54386e4af..29f7b5c0276 100644
--- a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
+++ b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
@@ -1830,7 +1830,7 @@ private:
public:
BoolAttributeFixture(const SimpleResult& true_docs, uint32_t num_docs)
- : _attr("bool_attr", search::GrowStrategy())
+ : _attr("bool_attr", search::GrowStrategy(), false)
{
_attr.addDocs(num_docs);
for (uint32_t i = 0; i < true_docs.getHitCount(); ++i) {
diff --git a/searchlib/src/tests/queryeval/queryeval.cpp b/searchlib/src/tests/queryeval/queryeval.cpp
index cdfe1cfca88..cc9e90bb761 100644
--- a/searchlib/src/tests/queryeval/queryeval.cpp
+++ b/searchlib/src/tests/queryeval/queryeval.cpp
@@ -339,7 +339,7 @@ class DummySingleValueBitNumericAttributeBlueprint : public SimpleLeafBlueprint
public:
DummySingleValueBitNumericAttributeBlueprint(const SimpleResult & result) :
SimpleLeafBlueprint(FieldSpecBaseList()),
- _a("a", search::GrowStrategy()),
+ _a("a", search::GrowStrategy(), false),
_sc(),
_tfmd()
{