diff options
57 files changed, 144 insertions, 114 deletions
diff --git a/config/src/tests/configholder/configholder.cpp b/config/src/tests/configholder/configholder.cpp index 8901ba65ad4..c103f86f6e9 100644 --- a/config/src/tests/configholder/configholder.cpp +++ b/config/src/tests/configholder/configholder.cpp @@ -61,7 +61,7 @@ TEST_MT_F("Require that wait is interrupted", 2, ConfigHolder) TEST_BARRIER(); } else { TEST_BARRIER(); - FastOS_Thread::Sleep(500); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); f.interrupt(); TEST_BARRIER(); } diff --git a/config/src/tests/subscription/subscription.cpp b/config/src/tests/subscription/subscription.cpp index 5974279518a..52b9ec624ac 100644 --- a/config/src/tests/subscription/subscription.cpp +++ b/config/src/tests/subscription/subscription.cpp @@ -79,7 +79,7 @@ TEST_MT_F("requireThatNextUpdateReturnsWhenNotified", 2, SubscriptionFixture(Con ASSERT_TRUE(f1.sub.nextUpdate(2, 5000)); ASSERT_TRUE(timer.MilliSecsToNow() > 200.0); } else { - FastOS_Thread::Sleep(500); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); f1.holder->handle(ConfigUpdate::UP(new ConfigUpdate(ConfigValue(), 1, 1))); } } @@ -94,7 +94,7 @@ TEST_MT_F("requireThatNextUpdateReturnsInterrupted", 2, SubscriptionFixture(Conf ASSERT_TRUE(f1.sub.nextUpdate(1, 5000)); ASSERT_TRUE(timer.MilliSecsToNow() > 300.0); } else { - FastOS_Thread::Sleep(500); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); f1.sub.close(); } } diff --git a/document/src/tests/testxml.cpp b/document/src/tests/testxml.cpp index da328c7a63f..a9abae531fa 100644 --- a/document/src/tests/testxml.cpp +++ b/document/src/tests/testxml.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/* $Id$*/ #include <vespa/document/base/testdocrepo.h> #include <cppunit/extensions/HelperMacros.h> @@ -8,6 +7,7 @@ #include <vespa/document/update/addvalueupdate.h> #include <vespa/document/update/assignvalueupdate.h> #include <vespa/document/update/removevalueupdate.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/vespalib/text/stringtokenizer.h> #include <vespa/vespalib/testkit/test_kit.h> diff --git a/document/src/vespa/document/annotation/spantree.cpp b/document/src/vespa/document/annotation/spantree.cpp index 199040ea8f6..61c7ac48817 100644 --- a/document/src/vespa/document/annotation/spantree.cpp +++ b/document/src/vespa/document/annotation/spantree.cpp @@ -1,9 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "spantree.h" -#include "annotation.h" #include "spannode.h" -#include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/stllike/asciistream.h> using std::unique_ptr; diff --git a/document/src/vespa/document/annotation/spantree.h b/document/src/vespa/document/annotation/spantree.h index d53e9002598..06558cf6887 100644 --- a/document/src/vespa/document/annotation/spantree.h +++ b/document/src/vespa/document/annotation/spantree.h @@ -4,6 +4,7 @@ #include <vespa/document/annotation/annotation.h> #include <vector> +#include <cassert> namespace document { class SpanNode; diff --git a/document/src/vespa/document/base/forcelink.cpp b/document/src/vespa/document/base/forcelink.cpp index b03433081d6..f17c8f582b3 100644 --- a/document/src/vespa/document/base/forcelink.cpp +++ b/document/src/vespa/document/base/forcelink.cpp @@ -3,6 +3,8 @@ #include "forcelink.h" #include <vespa/document/update/updates.h> #include <vespa/document/fieldvalue/fieldvalues.h> +#include <vespa/document/datatype/documenttype.h> + namespace document { diff --git a/document/src/vespa/document/datatype/annotationreferencedatatype.cpp b/document/src/vespa/document/datatype/annotationreferencedatatype.cpp index 2591cdbf37c..344fc31ed33 100644 --- a/document/src/vespa/document/datatype/annotationreferencedatatype.cpp +++ b/document/src/vespa/document/datatype/annotationreferencedatatype.cpp @@ -3,6 +3,7 @@ #include "annotationreferencedatatype.h" #include <vespa/document/fieldvalue/annotationreferencefieldvalue.h> #include <ostream> +#include <cassert> using std::unique_ptr; using std::ostream; diff --git a/document/src/vespa/document/fieldvalue/fieldvalue.cpp b/document/src/vespa/document/fieldvalue/fieldvalue.cpp index fd3093488ea..3279eb77a64 100644 --- a/document/src/vespa/document/fieldvalue/fieldvalue.cpp +++ b/document/src/vespa/document/fieldvalue/fieldvalue.cpp @@ -10,7 +10,7 @@ #include "doublefieldvalue.h" #include "bytefieldvalue.h" #include "predicatefieldvalue.h" - +#include <vespa/document/util/bytebuffer.h> #include <vespa/document/base/exceptions.h> #include <vespa/document/serialization/vespadocumentserializer.h> #include <vespa/vespalib/objects/nbostream.h> @@ -51,6 +51,21 @@ FieldValue::hash() const return vespalib::hashValue(os.c_str(), os.size()) ; } +bool +FieldValue::isA(const FieldValue& other) const { + return (getDataType()->isA(*other.getDataType())); +} +int +FieldValue::compare(const FieldValue& other) const { + const DataType & a = *getDataType(); + const DataType & b = *other.getDataType(); + return (a < b) + ? -1 + : (b < a) + ? 1 + : 0; +} + FieldValue& FieldValue::assign(const FieldValue& value) { diff --git a/document/src/vespa/document/fieldvalue/fieldvalue.h b/document/src/vespa/document/fieldvalue/fieldvalue.h index bb2a10a3f53..81e207bc31a 100644 --- a/document/src/vespa/document/fieldvalue/fieldvalue.h +++ b/document/src/vespa/document/fieldvalue/fieldvalue.h @@ -15,7 +15,6 @@ #include <vespa/document/datatype/datatype.h> #include <vespa/document/util/xmlserializable.h> #include <vespa/vespalib/util/polymorphicarrays.h> -#include <vespa/document/util/bytebuffer.h> #include <vespa/vespalib/objects/cloneable.h> #include <map> @@ -25,6 +24,8 @@ namespace vespalib { namespace document { +class ByteBuffer; + class FieldValue : public vespalib::Identifiable { protected: @@ -168,27 +169,18 @@ public: virtual const DataType *getDataType() const = 0; /** Wrapper for datatypes isA() function. See DataType. */ - virtual bool isA(const FieldValue& other) const - { return (getDataType()->isA(*other.getDataType())); } + virtual bool isA(const FieldValue& other) const; void serialize(vespalib::nbostream &stream) const; void serialize(ByteBuffer& buffer) const; - ByteBuffer::UP serialize() const; + std::unique_ptr<ByteBuffer> serialize() const; /** * Compares this fieldvalue with another fieldvalue. * Should return 0 if the two are equal, <0 if this object is "less" than * the other, and >0 if this object is more than the other. */ - virtual int compare(const FieldValue& other) const { - const DataType & a = *getDataType(); - const DataType & b = *other.getDataType(); - return (a < b) - ? -1 - : (b < a) - ? 1 - : 0; - } + virtual int compare(const FieldValue& other) const; /** * Returns true if this object have been altered since last diff --git a/document/src/vespa/document/fieldvalue/structfieldvalue.cpp b/document/src/vespa/document/fieldvalue/structfieldvalue.cpp index 079b730c8cc..d3cbcb77ba2 100644 --- a/document/src/vespa/document/fieldvalue/structfieldvalue.cpp +++ b/document/src/vespa/document/fieldvalue/structfieldvalue.cpp @@ -8,7 +8,6 @@ #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/util/crc.h> #include <vespa/document/datatype/positiondatatype.h> -#include <vespa/vespalib/util/vstringfmt.h> #include <vespa/document/util/serializableexceptions.h> #include <vespa/document/base/exceptions.h> @@ -53,6 +52,16 @@ StructFieldValue::swap(StructFieldValue & rhs) std::swap(_version, _version); } +const StructDataType & +StructFieldValue::getStructType() const { + return static_cast<const StructDataType &>(getType()); +} + +const CompressionConfig & +StructFieldValue::getCompressionConfig() const { + return getStructType().getCompressionConfig(); +} + void StructFieldValue::lazyDeserialize(const FixedTypeRepo &repo, uint16_t version, diff --git a/document/src/vespa/document/fieldvalue/structfieldvalue.h b/document/src/vespa/document/fieldvalue/structfieldvalue.h index a46a36c477d..d57c8b965f7 100644 --- a/document/src/vespa/document/fieldvalue/structfieldvalue.h +++ b/document/src/vespa/document/fieldvalue/structfieldvalue.h @@ -12,16 +12,17 @@ #include "structuredfieldvalue.h" #include "serializablearray.h" #include <vespa/document/util/compressionconfig.h> -#include <vespa/document/datatype/structdatatype.h> #include <vector> namespace document { + class Document; class DocumentType; class DocumentTypeRepo; class FieldValueWriter; class FixedTypeRepo; class FieldSet; +class StructDataType; class StructFieldValue : public StructuredFieldValue { @@ -73,7 +74,7 @@ public: const DocumentTypeRepo * getRepo() const { return _repo; } void setDocumentType(const DocumentType & docType) { _doc_type = & docType; } - const StructDataType & getStructType() const { return static_cast<const StructDataType &>(getType()); } + const StructDataType & getStructType() const; void lazyDeserialize(const FixedTypeRepo &repo, uint16_t version, @@ -99,8 +100,7 @@ public: const Field& getField(const vespalib::stringref & name) const override; void clear() override; - const CompressionConfig &getCompressionConfig() const - { return getStructType().getCompressionConfig(); } + const CompressionConfig &getCompressionConfig() const; // FieldValue implementation. FieldValue& assign(const FieldValue&) override; @@ -146,4 +146,3 @@ private: }; } // document - diff --git a/document/src/vespa/document/fieldvalue/tensorfieldvalue.cpp b/document/src/vespa/document/fieldvalue/tensorfieldvalue.cpp index d6396c43a46..03b7d50c1c1 100644 --- a/document/src/vespa/document/fieldvalue/tensorfieldvalue.cpp +++ b/document/src/vespa/document/fieldvalue/tensorfieldvalue.cpp @@ -3,6 +3,7 @@ #include "tensorfieldvalue.h" #include <vespa/eval/tensor/tensor.h> #include <ostream> +#include <cassert> using vespalib::tensor::Tensor; @@ -164,7 +165,6 @@ TensorFieldValue::compare(const FieldValue &other) const return ((_tensor.get() < rhs._tensor.get()) ? -1 : 1); } - IMPLEMENT_IDENTIFIABLE(TensorFieldValue, FieldValue); } // document diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp index b555e25c4cc..93adce76efd 100644 --- a/document/src/vespa/document/repo/documenttyperepo.cpp +++ b/document/src/vespa/document/repo/documenttyperepo.cpp @@ -14,8 +14,6 @@ #include <vespa/vespalib/util/exceptions.h> #include <vespa/document/config/config-documenttypes.h> #include <fstream> -#include <memory> -#include <utility> #include <vespa/log/log.h> LOG_SETUP(".documenttyperepo"); diff --git a/document/src/vespa/document/select/branch.cpp b/document/src/vespa/document/select/branch.cpp index ddbad69b14d..85e42dd74b5 100644 --- a/document/src/vespa/document/select/branch.cpp +++ b/document/src/vespa/document/select/branch.cpp @@ -2,6 +2,7 @@ #include "branch.h" #include "visitor.h" +#include <cassert> namespace document { namespace select { diff --git a/document/src/vespa/document/select/constant.cpp b/document/src/vespa/document/select/constant.cpp index 686ab05055c..a48492685f3 100644 --- a/document/src/vespa/document/select/constant.cpp +++ b/document/src/vespa/document/select/constant.cpp @@ -2,9 +2,9 @@ #include "constant.h" #include "visitor.h" +#include <cassert> -namespace document { -namespace select { +namespace document::select { Constant::Constant(const vespalib::stringref & value) : Node(value), @@ -54,5 +54,4 @@ Constant::print(std::ostream& out, bool, if (_parentheses) out << ')'; } -} // select -} // document +} diff --git a/document/src/vespa/document/select/doctype.cpp b/document/src/vespa/document/select/doctype.cpp index 3c23b2e5ba1..117f97ea1bc 100644 --- a/document/src/vespa/document/select/doctype.cpp +++ b/document/src/vespa/document/select/doctype.cpp @@ -5,9 +5,9 @@ #include <vespa/document/update/documentupdate.h> #include <vespa/document/fieldvalue/document.h> +#include <vespa/document/datatype/documenttype.h> -namespace document { -namespace select { +namespace document::select { namespace { bool documentTypeEqualsName(const DocumentType& type, @@ -88,5 +88,4 @@ DocType::print(std::ostream& out, bool verbose, if (_parentheses) out << ')'; } -} // select -} // document +} diff --git a/document/src/vespa/document/select/operator.cpp b/document/src/vespa/document/select/operator.cpp index b127e29c1ad..3c09a482cf0 100644 --- a/document/src/vespa/document/select/operator.cpp +++ b/document/src/vespa/document/select/operator.cpp @@ -4,9 +4,9 @@ #include <vespa/vespalib/util/regexp.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/stllike/hash_map.hpp> +#include <cassert> -namespace document { -namespace select { +namespace document::select { Operator::OperatorMap Operator::_operators; @@ -228,5 +228,4 @@ GlobOperator::containsVariables(const vespalib::stringref & expression) const GlobOperator GlobOperator::GLOB("="); -} // select -} // document +} diff --git a/document/src/vespa/document/select/valuenode.cpp b/document/src/vespa/document/select/valuenode.cpp index ebf0a466ad9..49eab9d75ff 100644 --- a/document/src/vespa/document/select/valuenode.cpp +++ b/document/src/vespa/document/select/valuenode.cpp @@ -4,6 +4,7 @@ #include "parser.h" #include <vespa/document/base/exceptions.h> #include <vespa/document/fieldvalue/fieldvalues.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/util/md5.h> #include <vespa/document/util/stringutil.h> #include <vespa/vespalib/text/lowercase.h> diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp index 866a215505c..d91b33650d4 100644 --- a/document/src/vespa/document/update/documentupdate.cpp +++ b/document/src/vespa/document/update/documentupdate.cpp @@ -1,4 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + #include "documentupdate.h" #include "documentupdateflags.h" #include <vespa/document/fieldvalue/fieldvalues.h> @@ -7,6 +8,7 @@ #include <vespa/vespalib/objects/nbostream.h> #include <vespa/document/util/bufferexceptions.h> #include <vespa/document/base/exceptions.h> +#include <vespa/document/datatype/documenttype.h> using vespalib::IllegalArgumentException; using vespalib::IllegalStateException; @@ -103,7 +105,28 @@ DocumentUpdate::affectsDocumentBody() const return false; } -// Print the content of this document update. +const DocumentType& +DocumentUpdate::getType() const { + return static_cast<const DocumentType &> (*_type); +} + +DocumentUpdate& +DocumentUpdate::addUpdate(const FieldUpdate& update) { + _updates.push_back(update); + return *this; +} + +DocumentUpdate& +DocumentUpdate::addFieldPathUpdate(const FieldPathUpdate::CP& update) { + _fieldPathUpdates.push_back(update); + return *this; +} + +DocumentUpdate* +DocumentUpdate::clone() const { + return new DocumentUpdate(*this); +} + void DocumentUpdate::print(std::ostream& out, bool verbose, const std::string& indent) const @@ -230,8 +253,7 @@ DocumentUpdate::deserialize42(const DocumentTypeRepo& repo, ByteBuffer& buffer) try{ buffer.getShortNetwork(_version); - std::pair<const DocumentType *, DocumentId> typeAndId( - deserializeTypeAndId(repo, buffer)); + std::pair<const DocumentType *, DocumentId> typeAndId(deserializeTypeAndId(repo, buffer)); _type = typeAndId.first; _documentId = typeAndId.second; // Read field updates, if any. diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h index 5d09bd36816..ce00d00088b 100644 --- a/document/src/vespa/document/update/documentupdate.h +++ b/document/src/vespa/document/update/documentupdate.h @@ -29,7 +29,6 @@ #include "fieldpathupdate.h" #include <vespa/document/base/documentid.h> #include <vespa/document/base/field.h> -#include <vespa/document/datatype/documenttype.h> #include <vespa/document/fieldvalue/fieldvalue.h> #include <vespa/document/util/bytebuffer.h> @@ -118,19 +117,13 @@ public: * Add a field update to this document update. * @return A reference to this. */ - DocumentUpdate& addUpdate(const FieldUpdate& update) { - _updates.push_back(update); - return *this; - } + DocumentUpdate& addUpdate(const FieldUpdate& update); /** * Add a fieldpath update to this document update. * @return A reference to this. */ - DocumentUpdate& addFieldPathUpdate(const FieldPathUpdate::CP& update) { - _fieldPathUpdates.push_back(update); - return *this; - } + DocumentUpdate& addFieldPathUpdate(const FieldPathUpdate::CP& update); /** @return The list of updates. */ const FieldUpdateV & getUpdates() const { return _updates; } @@ -141,7 +134,7 @@ public: bool affectsDocumentBody() const; /** @return The type of document this update is for. */ - const DocumentType& getType() const { return static_cast<const DocumentType &> (*_type); } + const DocumentType& getType() const; // Printable implementation void print(std::ostream& out, bool verbose, const std::string& indent) const override; @@ -159,9 +152,7 @@ public: void printXml(XmlOutputStream&) const override; // Cloneable implementation - virtual DocumentUpdate* clone() const { - return new DocumentUpdate(*this); - } + virtual DocumentUpdate* clone() const; /** * Sets whether this update should create the document it updates if that document does not exist. @@ -199,7 +190,6 @@ private: DocumentUpdate(); int deserializeFlags(int sizeAndFlags); - }; } // document diff --git a/documentapi/src/tests/messagebus/messagebus_test.cpp b/documentapi/src/tests/messagebus/messagebus_test.cpp index 58fc96b2e78..e4b04b0afc7 100644 --- a/documentapi/src/tests/messagebus/messagebus_test.cpp +++ b/documentapi/src/tests/messagebus/messagebus_test.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/document/base/testdocrepo.h> #include <vespa/document/fieldvalue/document.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/documentapi/documentapi.h> #include <vespa/vdslib/state/clusterstate.h> #include <vespa/vespalib/testkit/testapp.h> diff --git a/documentapi/src/tests/messages/messages50test.cpp b/documentapi/src/tests/messages/messages50test.cpp index 44aea1cb169..3c9f068468f 100644 --- a/documentapi/src/tests/messages/messages50test.cpp +++ b/documentapi/src/tests/messages/messages50test.cpp @@ -4,6 +4,7 @@ #include <vespa/document/datatype/datatype.h> #include <vespa/document/fieldvalue/document.h> #include <vespa/document/update/fieldpathupdates.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/documentapi/documentapi.h> #include <vespa/vdslib/container/writabledocumentlist.h> diff --git a/documentapi/src/tests/messages/messages52test.cpp b/documentapi/src/tests/messages/messages52test.cpp index 9339d23ee86..37a133add91 100644 --- a/documentapi/src/tests/messages/messages52test.cpp +++ b/documentapi/src/tests/messages/messages52test.cpp @@ -5,6 +5,7 @@ #include "messages52test.h" #include <vespa/documentapi/documentapi.h> #include <vespa/document/update/fieldpathupdates.h> +#include <vespa/document/datatype/documenttype.h> using document::DocumentTypeRepo; diff --git a/documentapi/src/tests/policies/policies_test.cpp b/documentapi/src/tests/policies/policies_test.cpp index 43c2b6c6e24..5d92b495c48 100644 --- a/documentapi/src/tests/policies/policies_test.cpp +++ b/documentapi/src/tests/policies/policies_test.cpp @@ -23,6 +23,7 @@ #include <vespa/vdslib/state/clusterstate.h> #include <vespa/document/base/testdocrepo.h> #include <vespa/document/fieldvalue/longfieldvalue.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/stringfmt.h> diff --git a/fastos/src/tests/tests.h b/fastos/src/tests/tests.h index cc54e66292f..6807741f86f 100644 --- a/fastos/src/tests/tests.h +++ b/fastos/src/tests/tests.h @@ -2,6 +2,7 @@ #include <vespa/fastos/app.h> #include <vespa/fastos/socket.h> +#include <vespa/fastos/thread.h> class BaseTest : public FastOS_Application { diff --git a/fastos/src/vespa/fastos/app.h b/fastos/src/vespa/fastos/app.h index 75fb5c30d43..faa6ff55c7d 100644 --- a/fastos/src/vespa/fastos/app.h +++ b/fastos/src/vespa/fastos/app.h @@ -13,8 +13,8 @@ #include <vespa/fastos/types.h> class FastOS_ProcessInterface; +class FastOS_ThreadPool; -#include <vespa/fastos/thread.h> #include <vespa/fastos/mutex.h> /** diff --git a/fastos/src/vespa/fastos/unix_process.h b/fastos/src/vespa/fastos/unix_process.h index d3b3f0f3d96..7438b96d434 100644 --- a/fastos/src/vespa/fastos/unix_process.h +++ b/fastos/src/vespa/fastos/unix_process.h @@ -13,7 +13,7 @@ #include <string> #include <memory> -class FastOS_ThreadPool; +class FastOS_BoolCond; class FastOS_UNIX_RealProcess; #include <vespa/fastos/ringbuffer.h> diff --git a/fnet/src/tests/sync_execute/sync_execute.cpp b/fnet/src/tests/sync_execute/sync_execute.cpp index ca77ab6f73b..8b0edb4476f 100644 --- a/fnet/src/tests/sync_execute/sync_execute.cpp +++ b/fnet/src/tests/sync_execute/sync_execute.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/fnet/transport.h> #include <vespa/fnet/iexecutable.h> +#include <vespa/fastos/thread.h> struct DoIt : public FNET_IExecutable { vespalib::Gate gate; diff --git a/persistence/src/tests/proxy/providerproxy_test.cpp b/persistence/src/tests/proxy/providerproxy_test.cpp index 514d9516c65..28ce33a2b5b 100644 --- a/persistence/src/tests/proxy/providerproxy_test.cpp +++ b/persistence/src/tests/proxy/providerproxy_test.cpp @@ -8,6 +8,7 @@ #include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/fieldvalue/document.h> #include <vespa/document/update/documentupdate.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/persistence/proxy/providerproxy.h> #include <vespa/persistence/proxy/providerstub.h> #include <vespa/persistence/spi/abstractpersistenceprovider.h> diff --git a/persistence/src/tests/proxy/providerstub_test.cpp b/persistence/src/tests/proxy/providerstub_test.cpp index 1028e06b8bc..c750a3c94af 100644 --- a/persistence/src/tests/proxy/providerstub_test.cpp +++ b/persistence/src/tests/proxy/providerstub_test.cpp @@ -7,6 +7,7 @@ #include <vespa/document/util/bytebuffer.h> #include <vespa/document/fieldvalue/document.h> #include <vespa/document/update/documentupdate.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/persistence/proxy/buildid.h> #include <vespa/persistence/proxy/providerstub.h> #include <vespa/persistence/spi/abstractpersistenceprovider.h> diff --git a/searchcore/src/tests/proton/common/selectpruner_test.cpp b/searchcore/src/tests/proton/common/selectpruner_test.cpp index 4ecefde024c..29ef6ef016c 100644 --- a/searchcore/src/tests/proton/common/selectpruner_test.cpp +++ b/searchcore/src/tests/proton/common/selectpruner_test.cpp @@ -3,6 +3,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/document/repo/configbuilder.h> #include <vespa/document/repo/documenttyperepo.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/searchcore/proton/common/selectpruner.h> #include <vespa/document/select/parser.h> #include <vespa/document/select/cloningvisitor.h> diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp index 0ccd5b8d6ee..8261ae80e02 100644 --- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp +++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp @@ -2,6 +2,7 @@ #include <vespa/document/fieldset/fieldsets.h> #include <vespa/document/fieldvalue/fieldvalues.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/persistence/spi/bucket.h> #include <vespa/persistence/spi/docentry.h> #include <vespa/persistence/spi/result.h> diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp index 5b550f9c49d..d757e48e7d0 100644 --- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp +++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp @@ -1,10 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <tests/proton/common/dummydbowner.h> -#include <vespa/document/repo/documenttyperepo.h> -#include <vespa/messagebus/emptyreply.h> -#include <vespa/messagebus/testlib/receptor.h> -#include <vespa/searchcommon/common/schema.h> #include <vespa/searchcore/proton/attribute/flushableattribute.h> #include <vespa/searchcore/proton/common/feedtoken.h> #include <vespa/searchcore/proton/common/hw_info.h> @@ -26,6 +22,9 @@ #include <vespa/searchcorespi/index/indexflushtarget.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/translogserver.h> +#include <vespa/messagebus/emptyreply.h> +#include <vespa/messagebus/testlib/receptor.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/vespalib/testkit/test_kit.h> diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp index 6077ca5fe76..1c8165d9f17 100644 --- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp +++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp @@ -25,6 +25,7 @@ #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/document/repo/configbuilder.h> #include <vespa/document/repo/documenttyperepo.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/testkit/testapp.h> using document::BucketId; diff --git a/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp b/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp index 45931307c0e..816e214aa0c 100644 --- a/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp +++ b/searchcore/src/tests/proton/metrics/documentdb_job_trackers/documentdb_job_trackers_test.cpp @@ -1,12 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("documentdb_job_trackers_test"); #include <vespa/searchcore/proton/metrics/documentdb_job_trackers.h> #include <vespa/searchcore/proton/metrics/job_tracked_flush_target.h> #include <vespa/searchcore/proton/test/dummy_flush_target.h> #include <vespa/vespalib/testkit/testapp.h> +#include <vespa/log/log.h> +LOG_SETUP("documentdb_job_trackers_test"); + using namespace proton; using namespace searchcorespi; @@ -61,7 +62,7 @@ TEST_F("require that job metrics are updated", Fixture) // Update metrics 2 times to ensure that all jobs are running // in the last interval we actually care about. f._trackers.updateMetrics(f._metrics); - FastOS_Thread::Sleep(100); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); f._trackers.updateMetrics(f._metrics); EXPECT_APPROX(1.0, f._metrics.attributeFlush.getLast(), EPS); diff --git a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp index 19843cb9531..8dea47e850f 100644 --- a/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp +++ b/searchcore/src/tests/proton/persistenceengine/persistenceengine_test.cpp @@ -1,5 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/document/repo/documenttyperepo.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/persistence/spi/documentselection.h> #include <vespa/searchcore/proton/persistenceengine/bucket_guard.h> #include <vespa/searchcore/proton/persistenceengine/ipersistenceengineowner.h> diff --git a/searchcore/src/tests/proton/server/documentretriever_test.cpp b/searchcore/src/tests/proton/server/documentretriever_test.cpp index 093853addcc..b0541f9ac71 100644 --- a/searchcore/src/tests/proton/server/documentretriever_test.cpp +++ b/searchcore/src/tests/proton/server/documentretriever_test.cpp @@ -30,11 +30,7 @@ #include <vespa/searchlib/attribute/integerbase.h> #include <vespa/searchlib/attribute/predicate_attribute.h> #include <vespa/searchlib/attribute/stringbase.h> -#include <vespa/searchlib/docstore/cachestats.h> -#include <vespa/searchlib/docstore/idocumentstore.h> -#include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/stringfmt.h> using document::ArrayFieldValue; using document::FieldValue; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp index 60cc292cbeb..a357fb92980 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp @@ -5,6 +5,7 @@ #include <vespa/searchcore/proton/common/attrupdate.h> #include <vespa/searchlib/attribute/attributevector.hpp> #include <vespa/searchlib/common/isequencedtaskexecutor.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/log/log.h> LOG_SETUP(".proton.server.attributeadapter"); diff --git a/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp b/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp index c166dfbe634..001eb7d16f3 100644 --- a/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/selectpruner.cpp @@ -2,15 +2,13 @@ #include "selectpruner.h" #include <vespa/document/base/exceptions.h> -#include <vespa/document/base/fieldpath.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/document/repo/documenttyperepo.h> #include <vespa/document/select/compare.h> -#include <vespa/document/select/operator.h> #include <vespa/document/select/constant.h> #include <vespa/document/select/branch.h> #include <vespa/document/select/doctype.h> #include <vespa/document/select/invalidconstant.h> -#include <vespa/document/select/constant.h> #include <vespa/searchlib/attribute/iattributemanager.h> using document::select::And; diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp index 2f36f5140df..aa1541d766e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp @@ -12,15 +12,13 @@ #include <vespa/documentapi/messagebus/messages/feedreply.h> #include <vespa/documentapi/messagebus/messages/removedocumentreply.h> #include <vespa/documentapi/messagebus/messages/updatedocumentreply.h> -#include <vespa/searchcore/proton/common/bucketfactory.h> -#include <vespa/searchcore/proton/feedoperation/moveoperation.h> -#include <vespa/searchcore/proton/feedoperation/operations.h> #include <vespa/searchcore/proton/persistenceengine/transport_latch.h> #include <vespa/searchcore/proton/bucketdb/ibucketdbhandler.h> #include <vespa/searchcorespi/index/ithreadingservice.h> #include <vespa/vespalib/util/closuretask.h> #include <vespa/searchcore/proton/persistenceengine/i_resource_write_filter.h> #include <vespa/vespalib/util/exceptions.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/log/log.h> LOG_SETUP(".proton.server.feedhandler"); diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index be8df97b683..271c127bcee 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -21,6 +21,7 @@ #include <vespa/searchlib/util/fileheadertk.h> #include <vespa/searchcommon/common/schemaconfigurer.h> #include <vespa/document/base/exceptions.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/closuretask.h> #include <vespa/vespalib/util/host_name.h> diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp index ac24469e4d2..e27a710022f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp @@ -2,23 +2,21 @@ #include "ireplayconfig.h" #include "storeonlyfeedview.h" -#include <vespa/searchcore/proton/common/bucketfactory.h> -#include <vespa/searchcore/proton/common/commit_time_tracker.h> -#include <vespa/searchcore/proton/common/feedtoken.h> -#include <vespa/searchcore/proton/metrics/feed_metrics.h> -#include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h> -#include <vespa/vespalib/stllike/string.h> -#include <vespa/vespalib/text/stringtokenizer.h> -#include <vespa/vespalib/util/closuretask.h> -#include <vespa/searchcore/proton/feedoperation/moveoperation.h> #include "forcecommitcontext.h" #include "operationdonecontext.h" #include "removedonecontext.h" #include "updatedonecontext.h" #include "putdonecontext.h" -#include <vespa/searchlib/common/lambdatask.h> +#include <vespa/searchcore/proton/common/commit_time_tracker.h> +#include <vespa/searchcore/proton/common/feedtoken.h> +#include <vespa/searchcore/proton/metrics/feed_metrics.h> +#include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h> #include <vespa/searchlib/common/scheduletaskcallback.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/util/exceptions.h> +#include <vespa/vespalib/text/stringtokenizer.h> +#include <vespa/vespalib/util/closuretask.h> + #include <vespa/log/log.h> LOG_SETUP(".proton.server.storeonlyfeedview"); diff --git a/searchlib/src/vespa/searchlib/query/querynoderesultbase.h b/searchlib/src/vespa/searchlib/query/querynoderesultbase.h index c0d47f0f11d..05f0c9033d5 100644 --- a/searchlib/src/vespa/searchlib/query/querynoderesultbase.h +++ b/searchlib/src/vespa/searchlib/query/querynoderesultbase.h @@ -2,6 +2,7 @@ #pragma once #include <vespa/vespalib/objects/cloneable.h> +#include <memory> namespace search { diff --git a/staging_vespalib/src/vespa/vespalib/objects/cloneable.h b/staging_vespalib/src/vespa/vespalib/objects/cloneable.h index c0b12272797..ea9c8002d6e 100644 --- a/staging_vespalib/src/vespa/vespalib/objects/cloneable.h +++ b/staging_vespalib/src/vespa/vespalib/objects/cloneable.h @@ -5,8 +5,6 @@ * @brief Superclass for objects implementing clone() deep copy. */ -#include <memory> - namespace vespalib { class Cloneable { diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp index 1f1198efc3c..b7d3554e506 100644 --- a/storage/src/tests/storageserver/documentapiconvertertest.cpp +++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp @@ -3,6 +3,7 @@ #include <vespa/document/base/testdocrepo.h> #include <cppunit/extensions/HelperMacros.h> #include <vespa/document/fieldvalue/document.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/documentapi/documentapi.h> #include <vespa/messagebus/emptyreply.h> #include <vespa/storage/storageserver/documentapiconverter.h> diff --git a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp index 5b907d21fcd..54ef503a772 100644 --- a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp @@ -5,6 +5,7 @@ #include "putoperation.h" #include "updateoperation.h" #include <vespa/document/fieldvalue/document.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/document/select/parser.h> #include <vespa/storageapi/message/persistence.h> #include <vespa/storageapi/message/batch.h> diff --git a/vdslib/src/vespa/vdslib/container/documentlist.cpp b/vdslib/src/vespa/vdslib/container/documentlist.cpp index 2b105a77408..71bee5cf624 100644 --- a/vdslib/src/vespa/vdslib/container/documentlist.cpp +++ b/vdslib/src/vespa/vdslib/container/documentlist.cpp @@ -5,8 +5,9 @@ #include <vespa/document/util/stringutil.h> #include <vespa/document/util/serializableexceptions.h> #include <vespa/document/update/documentupdate.h> -#include <vespa/log/log.h> +#include <vespa/document/datatype/documenttype.h> +#include <vespa/log/log.h> LOG_SETUP(".vdslib.container.documentlist"); using document::ByteBuffer; diff --git a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp index 1c80e3ba8ee..f265a6c947f 100644 --- a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp +++ b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp @@ -2,6 +2,7 @@ #include "mutabledocumentlist.h" #include <vespa/document/update/documentupdate.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/objects/nbostream.h> using vespalib::nbostream; diff --git a/vdslib/src/vespa/vdslib/container/operationlist.cpp b/vdslib/src/vespa/vdslib/container/operationlist.cpp index 6af338a4c0e..8c4515f15ff 100644 --- a/vdslib/src/vespa/vdslib/container/operationlist.cpp +++ b/vdslib/src/vespa/vdslib/container/operationlist.cpp @@ -3,6 +3,7 @@ #include "operationlist.h" #include "documentlist.h" #include <vespa/document/update/documentupdate.h> +#include <vespa/document/datatype/documenttype.h> #include <vespa/vespalib/objects/nbostream.h> namespace vdslib { @@ -22,8 +23,7 @@ int OperationList::getRequiredBufferSize() const { switch(_operations[i].opt) { case OperationList::Operation::REMOVE: { - document::Document doc(*document::DataType::DOCUMENT, - _operations[i].docId); + document::Document doc(*document::DataType::DOCUMENT, _operations[i].docId); doc.serializeHeader(stream); break; } diff --git a/vespaclient/src/vespa/vespaclient/spoolmaster/application.cpp b/vespaclient/src/vespa/vespaclient/spoolmaster/application.cpp index fe0880d9ea1..e708e623592 100644 --- a/vespaclient/src/vespa/vespaclient/spoolmaster/application.cpp +++ b/vespaclient/src/vespa/vespaclient/spoolmaster/application.cpp @@ -1,10 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/defaults.h> -#include <vector> -#include <string> +#include <thread> #include <iostream> #include <algorithm> -#include <cstdio> #include <dirent.h> #include <unistd.h> @@ -189,7 +187,7 @@ Application::Main() if (scanInbox() && findOutboxes()) { moveLinks(); } else { - FastOS_Thread::Sleep(200); + std::this_thread::sleep_for(std::chrono::milliseconds(200)); } } } diff --git a/vespalib/src/tests/atomic/atomic_bench.cpp b/vespalib/src/tests/atomic/atomic_bench.cpp index 003ef25ba45..6294f956507 100644 --- a/vespalib/src/tests/atomic/atomic_bench.cpp +++ b/vespalib/src/tests/atomic/atomic_bench.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/atomic.h> +#include <vespa/fastos/thread.h> #include <vector> #include <algorithm> #include <sstream> diff --git a/vespalib/src/tests/atomic/atomic_test.cpp b/vespalib/src/tests/atomic/atomic_test.cpp index 1133d9b51bd..09fc99edeb9 100644 --- a/vespalib/src/tests/atomic/atomic_test.cpp +++ b/vespalib/src/tests/atomic/atomic_test.cpp @@ -1,12 +1,14 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/log/log.h> -LOG_SETUP("atomic_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/atomic.h> +#include <vespa/fastos/thread.h> #include <vector> #include <algorithm> #include <sstream> +#include <vespa/log/log.h> +LOG_SETUP("atomic_test"); class Test : public vespalib::TestApp { diff --git a/vespalib/src/tests/benchmark_timer/benchmark_timer_test.cpp b/vespalib/src/tests/benchmark_timer/benchmark_timer_test.cpp index b0cd577cc66..ac6a57358d6 100644 --- a/vespalib/src/tests/benchmark_timer/benchmark_timer_test.cpp +++ b/vespalib/src/tests/benchmark_timer/benchmark_timer_test.cpp @@ -8,7 +8,7 @@ TEST("require that the benchmark timer can be used as advertised") { BenchmarkTimer timer(1.0); while (timer.has_budget()) { timer.before(); - FastOS_Thread::Sleep(5); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); timer.after(); } EXPECT_TRUE(timer.min_time() >= 0.0); @@ -17,15 +17,15 @@ TEST("require that the benchmark timer can be used as advertised") { TEST("require that the benchmark timer all-in-one benchmarking works") { uint32_t sleep_time = 5; - double t = BenchmarkTimer::benchmark([sleep_time](){FastOS_Thread::Sleep(sleep_time);}, 1.0); + double t = BenchmarkTimer::benchmark([sleep_time](){std::this_thread::sleep_for(std::chrono::milliseconds(sleep_time));}, 1.0); fprintf(stderr, "5 ms sleep takes: %g ms\n", t * 1000.0); } TEST("require that the benchmark timer all-in-one benchmarking with baseline works") { uint32_t work_time = 10; uint32_t baseline_time = 5; - double t = BenchmarkTimer::benchmark([&](){FastOS_Thread::Sleep(work_time);}, - [&](){FastOS_Thread::Sleep(baseline_time);}, 1.0); + double t = BenchmarkTimer::benchmark([&](){std::this_thread::sleep_for(std::chrono::milliseconds(work_time));}, + [&](){std::this_thread::sleep_for(std::chrono::milliseconds(baseline_time));}, 1.0); fprintf(stderr, "10 ms sleep - 5 ms sleep takes: %g ms\n", t * 1000.0); } @@ -33,8 +33,8 @@ TEST("require that the benchmark timer all-in-one benchmarking with baseline and uint32_t work_time = 2; uint32_t baseline_time = 1; uint32_t loop_cnt = 0; - double t = BenchmarkTimer::benchmark([&](){FastOS_Thread::Sleep(work_time); ++loop_cnt;}, - [&](){FastOS_Thread::Sleep(baseline_time);}, 7, 0.0); + double t = BenchmarkTimer::benchmark([&](){std::this_thread::sleep_for(std::chrono::milliseconds(work_time)); ++loop_cnt;}, + [&](){std::this_thread::sleep_for(std::chrono::milliseconds(baseline_time));}, 7, 0.0); EXPECT_EQUAL(loop_cnt, 7u); fprintf(stderr, "2 ms sleep - 1 ms sleep takes: %g ms\n", t * 1000.0); } diff --git a/vespalib/src/tests/delegatelist/delegatelist.cpp b/vespalib/src/tests/delegatelist/delegatelist.cpp index 11dd4d7d9e2..6a9751440a6 100644 --- a/vespalib/src/tests/delegatelist/delegatelist.cpp +++ b/vespalib/src/tests/delegatelist/delegatelist.cpp @@ -3,10 +3,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/delegatelist.hpp> #include <vespa/vespalib/util/guard.h> - -#include <memory> -#include <algorithm> -#include <vector> +#include <vespa/fastos/thread.h> #include <queue> #include <vespa/log/log.h> diff --git a/vespalib/src/tests/time/time_box_test.cpp b/vespalib/src/tests/time/time_box_test.cpp index 478d749e15d..32cf1eb66b3 100644 --- a/vespalib/src/tests/time/time_box_test.cpp +++ b/vespalib/src/tests/time/time_box_test.cpp @@ -10,13 +10,13 @@ TEST("require that long-lived timebox returns falling time left numbers") { double timeLeft = box.timeLeft(); EXPECT_TRUE(timeLeft <= last_timeLeft); last_timeLeft = timeLeft; - FastOS_Thread::Sleep(10); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); } } TEST("require that short-lived timebox times out") { vespalib::TimeBox box(0.125); - FastOS_Thread::Sleep(150); + std::this_thread::sleep_for(std::chrono::milliseconds(150)); EXPECT_FALSE(box.hasTimeLeft()); EXPECT_EQUAL(box.timeLeft(), 0.0); } @@ -27,7 +27,7 @@ TEST("require that short-lived timebox always returns at least minimum time") { double timeLeft = box.timeLeft(); EXPECT_TRUE(timeLeft <= 0.250); EXPECT_TRUE(timeLeft >= 0.125); - FastOS_Thread::Sleep(30); + std::this_thread::sleep_for(std::chrono::milliseconds(30)); } EXPECT_FALSE(box.hasTimeLeft()); EXPECT_EQUAL(box.timeLeft(), 0.125); diff --git a/vespalog/src/test/threads/testthreads.cpp b/vespalog/src/test/threads/testthreads.cpp index a708777f350..056f5aad2a2 100644 --- a/vespalog/src/test/threads/testthreads.cpp +++ b/vespalog/src/test/threads/testthreads.cpp @@ -1,12 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/app.h> #include <vespa/fastos/time.h> +#include <vespa/fastos/thread.h> #include <vespa/log/log.h> #include <iostream> using std::string; - LOG_SETUP(".threadtest"); class FileThread : public FastOS_Runnable diff --git a/vsm/src/tests/docsum/docsum.cpp b/vsm/src/tests/docsum/docsum.cpp index d854421ecb5..1b0fbf70623 100644 --- a/vsm/src/tests/docsum/docsum.cpp +++ b/vsm/src/tests/docsum/docsum.cpp @@ -1,8 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/testapp.h> - -#include <vector> #include <vespa/document/fieldvalue/fieldvalues.h> +#include <vespa/document/datatype/structdatatype.h> #include <vespa/vsm/common/docsum.h> #include <vespa/vsm/vsm/flattendocsumwriter.h> #include <vespa/vsm/vsm/slimefieldwriter.h> |