summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-05-24 22:34:35 +0200
committerHenning Baldersheim <balder@oath.com>2018-05-24 22:34:35 +0200
commit8b1864481358ed7df64e5b83f30ee0c44b72757b (patch)
tree0751e8ff2d2f68b8a5bb2cbe830fe6202b8c5e93 /searchlib
parent2cbb378700db04dfd9991e3261309eb2f7304ada (diff)
Change tests and reintroduce assert.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/attribute/searchcontext/searchcontext.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp
index 2f819905492..77504c4ab3c 100644
--- a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp
+++ b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp
@@ -204,6 +204,7 @@ private:
// test search iterator unpacking
void fillForSearchIteratorUnpackingTest(IntegerAttribute * ia, bool extra);
void testSearchIteratorUnpacking(const AttributePtr & ptr, SearchContext & sc, bool extra, bool strict) {
+ sc.fetchPostings(strict);
for (bool withElementId : {false, true}) {
testSearchIteratorUnpacking(ptr, sc, extra, strict, withElementId);
}
@@ -951,7 +952,6 @@ SearchContextTest::testSearchIteratorUnpacking(const AttributePtr & attr, Search
pos.setElementWeight(100);
md.appendPosition(pos);
- sc.fetchPostings(strict);
SearchBasePtr sb = sc.createIterator(&md, strict);
if (withElementId) {
sb = std::make_unique<attribute::ElementIterator>(std::move(sb), sc, md);
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp
index 15c6b1933ee..7793af8f510 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp
@@ -113,7 +113,7 @@ template <typename DataT>
void
PostingListSearchContextT<DataT>::fetchPostings(bool strict)
{
- if (_fetchPostingsDone) return;
+ assert (! _fetchPostingsDone);
_fetchPostingsDone = true;
if (_uniqueValues < 2u) {