aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp6
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_populator/attribute_populator_test.cpp6
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp10
-rw-r--r--searchcore/src/tests/proton/attribute/attributeflush_test.cpp20
-rw-r--r--searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp6
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp10
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp6
-rw-r--r--searchcore/src/tests/proton/documentdb/documentdb_test.cpp6
-rw-r--r--searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp5
-rw-r--r--searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp10
11 files changed, 45 insertions, 46 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
index 62d4e0823eb..6e6df7cc5e3 100644
--- a/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_manager/attribute_manager_test.cpp
@@ -30,7 +30,7 @@ LOG_SETUP("attribute_manager_test");
#include <vespa/searchlib/attribute/singlenumericattribute.hpp>
#include <vespa/searchlib/common/foregroundtaskexecutor.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/config-attributes.h>
namespace vespa { namespace config { namespace search {}}}
@@ -107,12 +107,12 @@ struct BaseFixture
test::DirectoryHandler _dirHandler;
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
BaseFixture()
: _dirHandler(test_dir),
_fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>())
+ _hwInfo()
{
}
};
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 1f69d9136cf..18942216647 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
@@ -11,7 +11,7 @@ LOG_SETUP("attribute_populator_test");
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/vespalib/util/stringfmt.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchlib/common/foregroundtaskexecutor.h>
using namespace document;
@@ -56,7 +56,7 @@ struct Fixture
test::DirectoryHandler _testDir;
DummyFileHeaderContext _fileHeader;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
AttributeManager::SP _mgr;
AttributePopulator _pop;
DocContext _ctx;
@@ -64,7 +64,7 @@ struct Fixture
: _testDir(TEST_DIR),
_fileHeader(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_mgr(new AttributeManager(TEST_DIR, "test.subdb",
TuneFileAttributes(),
_fileHeader, _attributeFieldWriter, _hwInfo)),
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index c8676efd551..89f27e8cc77 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -19,7 +19,7 @@ LOG_SETUP("attribute_test");
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/util/filekit.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/document/predicate/predicate_slime_builder.h>
@@ -103,7 +103,7 @@ struct Fixture
test::DirectoryHandler _dirHandler;
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
proton::AttributeManager::SP _m;
AttributeWriter aw;
@@ -111,7 +111,7 @@ struct Fixture
: _dirHandler(test_dir),
_fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_m(std::make_shared<proton::AttributeManager>
(test_dir, "test.subdb", TuneFileAttributes(),
_fileHeaderContext, _attributeFieldWriter, _hwInfo)),
@@ -530,7 +530,7 @@ struct FilterFixture
test::DirectoryHandler _dirHandler;
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
proton::AttributeManager::SP _baseMgr;
FilterAttributeManager _filterMgr;
@@ -538,7 +538,7 @@ struct FilterFixture
: _dirHandler(test_dir),
_fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_baseMgr(new proton::AttributeManager(test_dir, "test.subdb",
TuneFileAttributes(),
_fileHeaderContext,
diff --git a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
index 2d43e0b06db..ecd80358f5b 100644
--- a/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attributeflush_test.cpp
@@ -16,7 +16,7 @@ LOG_SETUP("attributeflush_test");
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/common/foregroundtaskexecutor.h>
#include <vespa/searchcore/proton/test/directory_handler.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchlib/attribute/attributevector.hpp>
using namespace document;
@@ -217,7 +217,7 @@ private:
void
requireThatShrinkWorks();
- void requireThatFlushedAttributeCanBeLoaded(std::shared_ptr<vespalib::IHwInfo> hwInfo);
+ void requireThatFlushedAttributeCanBeLoaded(const HwInfo &hwInfo);
void requireThatFlushedAttributeCanBeLoaded();
public:
int
@@ -232,15 +232,15 @@ struct BaseFixture
test::DirectoryHandler _dirHandler;
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
BaseFixture()
: _dirHandler(test_dir),
_fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>())
+ _hwInfo()
{
}
- BaseFixture(const std::shared_ptr<IHwInfo> &hwInfo)
+ BaseFixture(const HwInfo &hwInfo)
: _dirHandler(test_dir),
_fileHeaderContext(),
_attributeFieldWriter(),
@@ -280,7 +280,7 @@ struct Fixture : public BaseFixture, public AttributeManagerFixture
AttributeManagerFixture(*static_cast<BaseFixture *>(this))
{
}
- Fixture(const std::shared_ptr<IHwInfo> &hwInfo)
+ Fixture(const HwInfo &hwInfo)
: BaseFixture(hwInfo),
AttributeManagerFixture(*static_cast<BaseFixture *>(this))
{
@@ -560,11 +560,11 @@ Test::requireThatShrinkWorks()
}
void
-Test::requireThatFlushedAttributeCanBeLoaded(std::shared_ptr<vespalib::IHwInfo> hwInfo)
+Test::requireThatFlushedAttributeCanBeLoaded(const HwInfo &hwInfo)
{
constexpr uint32_t numDocs = 100;
BaseFixture f(hwInfo);
- vespalib::string attrName(hwInfo->spinningDisk() ? "a11spin" : "a11ssd");
+ vespalib::string attrName(hwInfo.slowDisk() ? "a11slow" : "a11fast");
{
AttributeManagerFixture amf(f);
AttributeManager &am = amf._m;
@@ -593,8 +593,8 @@ Test::requireThatFlushedAttributeCanBeLoaded(std::shared_ptr<vespalib::IHwInfo>
void
Test::requireThatFlushedAttributeCanBeLoaded()
{
- TEST_DO(requireThatFlushedAttributeCanBeLoaded(std::make_shared<vespalib::MockHwInfo>(false)));
- TEST_DO(requireThatFlushedAttributeCanBeLoaded(std::make_shared<vespalib::MockHwInfo>(true)));
+ TEST_DO(requireThatFlushedAttributeCanBeLoaded(HwInfo(false)));
+ TEST_DO(requireThatFlushedAttributeCanBeLoaded(HwInfo(true)));
}
int
diff --git a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
index b7089623e97..4047a02121c 100644
--- a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
@@ -11,7 +11,7 @@ LOG_SETUP("attributes_state_explorer_test");
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/common/foregroundtaskexecutor.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
using namespace proton;
using namespace proton::test;
@@ -27,14 +27,14 @@ struct Fixture
DirectoryHandler _dirHandler;
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
AttributeManager::SP _mgr;
AttributeManagerExplorer _explorer;
Fixture()
: _dirHandler(TEST_DIR),
_fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
_fileHeaderContext,
_attributeFieldWriter,
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 8d71bba6841..ef3806d04c0 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -24,7 +24,7 @@ LOG_SETUP("docsummary_test");
#include <vespa/vespalib/tensor/tensor_factory.h>
#include <vespa/vespalib/tensor/default_tensor.h>
#include <vespa/searchlib/tensor/tensor_attribute.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
using namespace document;
using namespace search;
@@ -144,7 +144,7 @@ public:
DocumentDBConfig::DocumenttypesConfigSP _documenttypesConfig;
const DocumentTypeRepo::SP _repo;
TuneFileDocumentDB::SP _tuneFileDocumentDB;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
std::unique_ptr<DocumentDB> _ddb;
AttributeWriter::UP _aw;
ISummaryAdapter::SP _sa;
@@ -163,7 +163,7 @@ public:
_documenttypesConfig(new DocumenttypesConfig()),
_repo(repo),
_tuneFileDocumentDB(new TuneFileDocumentDB()),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_ddb(),
_aw(),
_sa()
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 556e10a7a6c..974efcdef6a 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -24,7 +24,7 @@ LOG_SETUP("configurer_test");
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/transactionlog/nosyncproxy.h>
#include <vespa/vespalib/io/fileutil.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
using namespace config;
using namespace document;
@@ -94,7 +94,7 @@ struct ViewSet
CommitTimeTracker _commitTimeTracker;
VarHolder<SearchView::SP> searchView;
VarHolder<SearchableFeedView::SP> feedView;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
ViewSet()
: _reconfigurer(),
_fileHeaderContext(),
@@ -110,7 +110,7 @@ struct ViewSet
_commitTimeTracker(TimeStamp()),
searchView(),
feedView(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>())
+ _hwInfo()
{
}
@@ -252,7 +252,7 @@ struct MyFastAccessFeedView
DummyFileHeaderContext _fileHeaderContext;
DocIdLimit _docIdLimit;
IThreadingService &_writeService;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
IDocumentMetaStoreContext::SP _dmsc;
std::unique_ptr<documentmetastore::ILidReuseDelayer> _lidReuseDelayer;
@@ -264,7 +264,7 @@ struct MyFastAccessFeedView
_fileHeaderContext(),
_docIdLimit(0),
_writeService(writeService),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_dmsc(),
_lidReuseDelayer(),
_commitTimeTracker(TimeStamp()),
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index d72ddc5a2a8..152b1f5cf29 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -21,7 +21,7 @@ LOG_SETUP("document_subdbs_test");
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <iostream>
@@ -128,7 +128,7 @@ struct MyStoreOnlyContext
MyFileHeaderContext _fileHeader;
LegacyDocumentDBMetrics _metrics;
vespalib::Lock _configLock;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
StoreOnlyContext _ctx;
MyStoreOnlyContext(IThreadingService &writeService,
ThreadStackExecutorBase &summaryExecutor,
@@ -141,7 +141,7 @@ struct MyStoreOnlyContext
_fileHeader(),
_metrics(DOCTYPE_NAME, 1),
_configLock(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_ctx(_owner,
_syncProxy,
_getSerialNum,
diff --git a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
index 125127d5af9..aabff1f35d1 100644
--- a/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/documentdb_test.cpp
@@ -21,7 +21,7 @@ LOG_SETUP("documentdb_test");
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <tests/proton/common/dummydbowner.h>
#include <vespa/vespalib/testkit/test_kit.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
using document::DocumentType;
using document::DocumentTypeRepo;
@@ -57,7 +57,7 @@ struct Fixture {
DummyWireService _dummy;
DummyDBOwner _dummyDBOwner;
vespalib::ThreadStackExecutor _summaryExecutor;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
DocumentDB::SP _db;
DummyFileHeaderContext _fileHeaderContext;
TransLogServer _tls;
@@ -71,7 +71,7 @@ Fixture::Fixture()
: _dummy(),
_dummyDBOwner(),
_summaryExecutor(8, 128*1024),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_db(),
_fileHeaderContext(),
_tls("tmp", 9014, ".", _fileHeaderContext),
diff --git a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
index cc77eb63c29..df2758eab1b 100644
--- a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
@@ -17,7 +17,7 @@ LOG_SETUP("documentmetastore_test");
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/searchcore/proton/server/itlssyncer.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
using namespace document;
using search::AttributeVector;
@@ -1833,8 +1833,7 @@ TEST("requireThatShrinkViaFlushTargetWorks")
TuneFileAttributes tuneFileAttributes;
DummyFileHeaderContext fileHeaderContext;
DummyTlsSyncer dummyTlsSyncer;
- std::shared_ptr<vespalib::IHwInfo> hwInfo =
- std::make_shared<vespalib::MockHwInfo>();
+ HwInfo hwInfo;
vespalib::rmdir("dmsflush", true);
vespalib::mkdir("dmsflush");
IFlushTarget::SP ft(new DocumentMetaStoreFlushTarget(dms,
diff --git a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
index ebd5107f0a5..44eb1353637 100644
--- a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
+++ b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
@@ -13,7 +13,7 @@ LOG_SETUP("attribute_reprocessing_initializer_test");
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/mock_hw_info.h>
+#include <vespa/searchcore/proton/common/hw_info.h>
#include <vespa/searchlib/common/foregroundtaskexecutor.h>
using namespace proton;
@@ -53,14 +53,14 @@ struct MyConfig
{
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
AttributeManager::SP _mgr;
search::index::Schema _schema;
MyDocTypeInspector::SP _inspector;
MyConfig()
: _fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
_fileHeaderContext,
_attributeFieldWriter, _hwInfo)),
@@ -97,7 +97,7 @@ struct Fixture
test::DirectoryHandler _dirHandler;
DummyFileHeaderContext _fileHeaderContext;
ForegroundTaskExecutor _attributeFieldWriter;
- std::shared_ptr<vespalib::IHwInfo> _hwInfo;
+ HwInfo _hwInfo;
AttributeManager::SP _mgr;
MyConfig _oldCfg;
MyConfig _newCfg;
@@ -107,7 +107,7 @@ struct Fixture
: _dirHandler(TEST_DIR),
_fileHeaderContext(),
_attributeFieldWriter(),
- _hwInfo(std::make_shared<vespalib::MockHwInfo>()),
+ _hwInfo(),
_mgr(new AttributeManager(TEST_DIR, "test.subdb", TuneFileAttributes(),
_fileHeaderContext,
_attributeFieldWriter, _hwInfo)),