aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/attribute
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-10-11 12:30:17 +0200
committerTor Egge <Tor.Egge@online.no>2022-10-11 12:30:17 +0200
commit3b6a6f18ca3a0037035373cb2049661d95c16641 (patch)
treee7b488108e20ee4f87b68d63f37e5fc62940801b /searchcore/src/tests/proton/attribute
parent6ddc05137b76e149de29692eda592ff9b2f2dab7 (diff)
Stop using search::index::DocBuilder in DocumentFieldPopulator unit
test and document subdbs unit test.
Diffstat (limited to 'searchcore/src/tests/proton/attribute')
-rw-r--r--searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp b/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp
index b08764289e6..055a38b9943 100644
--- a/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp
+++ b/searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp
@@ -1,12 +1,13 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/document/datatype/datatype.h>
+#include <vespa/document/repo/configbuilder.h>
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/searchcommon/attribute/config.h>
#include <vespa/searchcore/proton/attribute/document_field_populator.h>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/integerbase.h>
-#include <vespa/searchlib/index/docbuilder.h>
-#include <vespa/searchcommon/common/schema.h>
-#include <vespa/searchcommon/attribute/config.h>
+#include <vespa/searchlib/index/empty_doc_builder.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/log/log.h>
@@ -20,33 +21,17 @@ using namespace search::index;
typedef search::attribute::Config AVConfig;
typedef search::attribute::BasicType AVBasicType;
-Schema::AttributeField
-createAttributeField()
-{
- return Schema::AttributeField("a1", Schema::DataType::INT32);
-}
-
-Schema
-createSchema()
-{
- Schema schema;
- schema.addAttributeField(createAttributeField());
- return schema;
-}
-
struct DocContext
{
- Schema _schema;
- DocBuilder _builder;
+ EmptyDocBuilder _builder;
DocContext()
- : _schema(createSchema()),
- _builder(_schema)
+ : _builder([](auto& header) { header.addField("a1", DataType::T_INT); })
{
}
Document::UP create(uint32_t id) {
vespalib::string docId =
vespalib::make_string("id:searchdocument:searchdocument::%u", id);
- return _builder.startDocument(docId).endDocument();
+ return _builder.make_document(docId);
}
};