diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-21 16:22:32 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-21 16:22:32 +0000 |
commit | 83a2ef4c43a00eb09d31e41925260f5ea85c40bd (patch) | |
tree | 697739afd95dd8d7542b2c7a198ae33581bc624f /searchcore/src/tests/proton/proton_disk_layout | |
parent | 1bb2800fb1bf312689115a7230b1d3ead74d4ac6 (diff) |
Add helper classes containg a FNET_Transport and a FastOS_ThreadPool to reduce test boiler plate.
Diffstat (limited to 'searchcore/src/tests/proton/proton_disk_layout')
-rw-r--r-- | searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt | 1 | ||||
-rw-r--r-- | searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp | 15 |
2 files changed, 6 insertions, 10 deletions
diff --git a/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt b/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt index 1c22818630c..5b6c84393f7 100644 --- a/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt +++ b/searchcore/src/tests/proton/proton_disk_layout/CMakeLists.txt @@ -3,6 +3,7 @@ vespa_add_executable(searchcore_proton_disk_layout_test_app TEST SOURCES proton_disk_layout_test.cpp DEPENDS + searchcore_test searchcore_server searchcore_fconfig ) diff --git a/searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp b/searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp index 015d649f755..08b9a55746b 100644 --- a/searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp +++ b/searchcore/src/tests/proton/proton_disk_layout/proton_disk_layout_test.cpp @@ -2,6 +2,7 @@ #include <vespa/searchcore/proton/server/proton_disk_layout.h> #include <vespa/searchcore/proton/common/doctypename.h> +#include <vespa/searchcore/proton/test/transport_helper.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/translogserver.h> #include <vespa/searchlib/transactionlog/translogclient.h> @@ -9,14 +10,13 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/test/insertion_operators.h> #include <vespa/vespalib/util/stringfmt.h> -#include <vespa/vespalib/util/size_literals.h> -#include <vespa/fnet/transport.h> using search::index::DummyFileHeaderContext; using search::transactionlog::client::TransLogClient; using search::transactionlog::TransLogServer; using proton::DocTypeName; using proton::ProtonDiskLayout; +using proton::TransportMgr; static constexpr unsigned int tlsPort = 9018; @@ -31,8 +31,7 @@ struct FixtureBase struct DiskLayoutFixture { DummyFileHeaderContext _fileHeaderContext; - FastOS_ThreadPool _threadPool; - FNET_Transport _transport; + TransportMgr _transport; TransLogServer _tls; vespalib::string _tlsSpec; ProtonDiskLayout _diskLayout; @@ -95,18 +94,14 @@ struct DiskLayoutFixture { DiskLayoutFixture::DiskLayoutFixture() : _fileHeaderContext(), - _threadPool(64_Ki), _transport(), - _tls(_transport, "tls", tlsPort, baseDir, _fileHeaderContext), + _tls(_transport.transport(), "tls", tlsPort, baseDir, _fileHeaderContext), _tlsSpec(vespalib::make_string("tcp/localhost:%u", tlsPort)), _diskLayout(baseDir, _tlsSpec) { - _transport.Start(&_threadPool); } -DiskLayoutFixture::~DiskLayoutFixture() { - _transport.ShutDown(true); -} +DiskLayoutFixture::~DiskLayoutFixture() = default; struct Fixture : public FixtureBase, public DiskLayoutFixture { |