summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-03 23:56:30 +0200
committerGitHub <noreply@github.com>2020-10-03 23:56:30 +0200
commit3b3896aac6b7ea6b5bace26c39647e2ec960fcf7 (patch)
tree84f06ed9f5318214f37f4adc5c48a3bd2140bc27
parentac901be72bd373a6e49f8a8149fd5c71e7eaae39 (diff)
parente278469ad6d752da7e33228d0a78a6f02b29ffbb (diff)
Merge pull request #14699 from vespa-engine/balder/fix-tests
Use correct serial number when creating attribute.
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp9
-rw-r--r--searchcore/src/tests/proton/attribute/document_field_populator/document_field_populator_test.cpp7
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp5
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h2
9 files changed, 19 insertions, 20 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
index f81644c3f55..683a6cd1197 100644
--- a/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp
@@ -41,7 +41,7 @@ makeDocTypeRepo()
Struct("searchdocument.header"),
Struct("searchdocument.body").
addField("a1", DataType::T_INT));
- return std::unique_ptr<const DocumentTypeRepo>(new DocumentTypeRepo(builder.config()));
+ return std::make_unique<DocumentTypeRepo>(builder.config());
}
struct DocContext
@@ -76,13 +76,12 @@ struct Fixture
_attributeFieldWriter(),
_shared(),
_hwInfo(),
- _mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
- _fileHeader, _attributeFieldWriter, _shared, _hwInfo)),
+ _mgr(std::make_shared<AttributeManager>(TEST_DIR, "test.subdb", TuneFileAttributes(),
+ _fileHeader, _attributeFieldWriter, _shared, _hwInfo)),
_pop(),
_ctx()
{
- _mgr->addAttribute({ "a1", AVConfig(AVBasicType::INT32)},
- CREATE_SERIAL_NUM);
+ _mgr->addAttribute({ "a1", AVConfig(AVBasicType::INT32)}, CREATE_SERIAL_NUM);
_pop = std::make_unique<AttributePopulator>(_mgr, 1, "test", CREATE_SERIAL_NUM);
}
AttributeGuard::UP getAttr() {
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 a684f24f20d..4fd8b4208da 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,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("document_field_populator_test");
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcommon/common/schema.h>
#include <vespa/searchcore/proton/attribute/document_field_populator.h>
#include <vespa/searchlib/attribute/attributefactory.h>
@@ -10,6 +8,9 @@ LOG_SETUP("document_field_populator_test");
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP("document_field_populator_test");
+
using namespace document;
using namespace proton;
using namespace search;
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 7d5dbb8ca71..7e4e05f6948 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -1045,10 +1045,9 @@ TEST("requireThatPositionsAreUsed")
endDocument();
dc.put(*exp, 1);
- IDocumentStore & store =
- dc._ddb->getReadySubDB()->getSummaryManager()->getBackingStore();
+ IDocumentStore & store = dc._ddb->getReadySubDB()->getSummaryManager()->getBackingStore();
Document::UP act = store.read(1, *bc._repo);
- EXPECT_TRUE(act.get() != nullptr);
+ EXPECT_TRUE(act);
EXPECT_EQUAL(exp->getType(), act->getType());
DocsumRequest req;
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index a97345bcfbb..b275064c0f2 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -323,7 +323,7 @@ struct MyAttributeWriter : public IAttributeWriter
MyTracer &_tracer;
MyAttributeWriter(MyTracer &tracer);
- ~MyAttributeWriter();
+ ~MyAttributeWriter() override;
std::vector<AttributeVector *>
getWritableAttributes() const override {
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp
index 9ede0bda577..5208195a968 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.cpp
@@ -65,8 +65,7 @@ AttributePopulator::AttributePopulator(const proton::IAttributeManager::SP &mgr,
AttributePopulator::~AttributePopulator()
{
if (LOG_WOULD_LOG(event)) {
- EventLogger::populateAttributeComplete(getNames(),
- _currSerialNum - _initSerialNum);
+ EventLogger::populateAttributeComplete(getNames(),_currSerialNum - _initSerialNum);
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h
index eae3329fe5a..a0dbb2e4560 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_populator.h
@@ -30,13 +30,12 @@ public:
search::SerialNum initSerialNum,
const vespalib::string &subDbName,
search::SerialNum configSerialNum);
- ~AttributePopulator();
+ ~AttributePopulator() override;
const IAttributeWriter &getWriter() const { return _writer; }
- // Implements IReprocessingReader
- virtual void handleExisting(uint32_t lid, const std::shared_ptr<document::Document> &doc) override;
- virtual void done() override;
+ void handleExisting(uint32_t lid, const std::shared_ptr<document::Document> &doc) override;
+ void done() override;
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
index 71a4eddbb08..28eeb541a13 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
@@ -214,6 +214,8 @@ applyCommit(SerialNum serialNum, AttributeWriter::OnWriteDoneType , AttributeVec
if (attr.getStatus().getLastSyncToken() <= serialNum) {
if (serialNum > attr.getCreateSerialNum()) {
attr.commit(serialNum, serialNum);
+ } else {
+ attr.commit();
}
}
}
diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp
index 885f577ab4e..2a38f788ca4 100644
--- a/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/reprocessing/document_reprocessing_handler.cpp
@@ -27,7 +27,7 @@ DocumentReprocessingHandler::DocumentReprocessingHandler(uint32_t docIdLimit)
_docIdLimit(docIdLimit)
{}
-DocumentReprocessingHandler::~DocumentReprocessingHandler() {}
+DocumentReprocessingHandler::~DocumentReprocessingHandler() = default;
void
DocumentReprocessingHandler::visit(uint32_t lid, const std::shared_ptr<document::Document> &doc)
diff --git a/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h b/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h
index a05fa327082..1624fc0f225 100644
--- a/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h
+++ b/searchcore/src/vespa/searchcore/proton/reprocessing/i_reprocessing_reader.h
@@ -14,7 +14,7 @@ struct IReprocessingReader
{
typedef std::shared_ptr<IReprocessingReader> SP;
- virtual ~IReprocessingReader() {}
+ virtual ~IReprocessingReader() = default;
/**
* Handle the given existing document.