diff options
Diffstat (limited to 'memfilepersistence/src/tests/spi')
14 files changed, 24 insertions, 72 deletions
diff --git a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp index 2f7913b0e1f..bc450a7a84a 100644 --- a/memfilepersistence/src/tests/spi/basicoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/basicoperationhandlertest.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/fastos.h> -#include <vespa/vdstestlib/cppunit/macros.h> -#include <tests/spi/memfiletestutils.h> -#include <tests/spi/simulatedfailurefile.h> -#include <tests/spi/options_builder.h> +#include "memfiletestutils.h" +#include "simulatedfailurefile.h" +#include "options_builder.h" #include <vespa/document/fieldset/fieldsetrepo.h> #include <vespa/document/fieldset/fieldsets.h> +#include <vespa/vdstestlib/cppunit/macros.h> + namespace storage { namespace memfile { diff --git a/memfilepersistence/src/tests/spi/buffer_test.cpp b/memfilepersistence/src/tests/spi/buffer_test.cpp index 0addb1032f5..6c098baef07 100644 --- a/memfilepersistence/src/tests/spi/buffer_test.cpp +++ b/memfilepersistence/src/tests/spi/buffer_test.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/memfilepersistence/mapper/buffer.h> diff --git a/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp b/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp index b59e8a32258..69f64376f60 100644 --- a/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp +++ b/memfilepersistence/src/tests/spi/buffered_file_writer_test.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/memfilepersistence/mapper/bufferedfilewriter.h> #include <vespa/memfilepersistence/mapper/buffer.h> diff --git a/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp b/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp index 673a72068b7..4372a8a45a7 100644 --- a/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/iteratorhandlertest.cpp @@ -1,14 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <set> -#include <vector> -#include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h> #include <tests/spi/memfiletestutils.h> #include <tests/spi/simulatedfailurefile.h> #include <tests/spi/options_builder.h> -#include <vespa/document/fieldset/fieldsets.h> #include <vespa/document/select/parser.h> namespace storage { diff --git a/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp index 78601b461ab..7da80a78913 100644 --- a/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/joinoperationhandlertest.cpp @@ -1,10 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> +#include "memfiletestutils.h" #include <vespa/document/datatype/documenttype.h> -#include <tests/spi/memfiletestutils.h> -#include <tests/spi/simulatedfailurefile.h> -#include <vespa/vdstestlib/cppunit/macros.h> using document::DocumentType; diff --git a/memfilepersistence/src/tests/spi/memcachetest.cpp b/memfilepersistence/src/tests/spi/memcachetest.cpp index 07697b79cac..7eece580b0a 100644 --- a/memfilepersistence/src/tests/spi/memcachetest.cpp +++ b/memfilepersistence/src/tests/spi/memcachetest.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/fastos/fastos.h> #include <vespa/memfilepersistence/memfile/memfilecache.h> #include <vespa/storageframework/defaultimplementation/memory/simplememorylogic.h> #include <tests/spi/memfiletestutils.h> -#include <vespa/vdstestlib/cppunit/macros.h> namespace storage { diff --git a/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp b/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp index eefe962979d..265054a02ba 100644 --- a/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp +++ b/memfilepersistence/src/tests/spi/memfileautorepairtest.cpp @@ -1,13 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/memfilepersistence/mapper/memfilemapper.h> #include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h> #include <vespa/memfilepersistence/mapper/memfile_v1_verifier.h> -#include <vespa/memfilepersistence/mapper/fileinfo.h> -#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h> #include <tests/spi/memfiletestutils.h> -#include <vespa/vdstestlib/cppunit/macros.h> namespace storage { namespace memfile { diff --git a/memfilepersistence/src/tests/spi/memfiletestutils.h b/memfilepersistence/src/tests/spi/memfiletestutils.h index d6bdbc3ff96..5eeddf18818 100644 --- a/memfilepersistence/src/tests/spi/memfiletestutils.h +++ b/memfilepersistence/src/tests/spi/memfiletestutils.h @@ -79,7 +79,7 @@ public: void setupDisks(uint32_t disks); - void tearDown() { + void tearDown() override{ _env.reset(); _componentRegister.reset(); _memoryManager.reset(); @@ -290,7 +290,7 @@ public: class SingleDiskMemFileTestUtils : public MemFileTestUtils { public: - void setUp() { + void setUp() override { setupDisks(1); } }; diff --git a/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp b/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp index ad20a28ed0c..f612bec1189 100644 --- a/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp +++ b/memfilepersistence/src/tests/spi/memfilev1serializertest.cpp @@ -1,11 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/memfilepersistence/mapper/memfilemapper.h> #include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h> -#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h> #include <tests/spi/memfiletestutils.h> -#include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/memfilepersistence/mapper/locationreadplanner.h> #include <tests/spi/simulatedfailurefile.h> #include <tests/spi/options_builder.h> @@ -229,23 +226,16 @@ struct DummyMemFileIOInterface : MemFileIOInterface { void clear(DocumentPart) override {} bool verifyConsistent() const override { return true; } void move(const FileSpecification&) override {} - DataLocation copyCache(const MemFileIOInterface&, - DocumentPart, - DataLocation) override - { + DataLocation copyCache(const MemFileIOInterface&, DocumentPart, DataLocation) override { return DataLocation(); } - void close() override {} + void close() override {}; bool isCached(DataLocation, DocumentPart) const override { return false; } bool isPersisted(DataLocation, DocumentPart) const override { return false; } - uint32_t getSerializedSize(DocumentPart, - DataLocation) const override { return 0; } + uint32_t getSerializedSize(DocumentPart, DataLocation) const override { return 0; } - void ensureCached(Environment&, - DocumentPart, - const std::vector<DataLocation>&) override - {} + void ensureCached(Environment&, DocumentPart, const std::vector<DataLocation>&) override {} size_t getCachedSize(DocumentPart) const override { return 0; } }; diff --git a/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp b/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp index 51951e22aea..632bded6c6c 100644 --- a/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp +++ b/memfilepersistence/src/tests/spi/memfilev1verifiertest.cpp @@ -1,14 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/memfilepersistence/mapper/memfilemapper.h> #include <vespa/memfilepersistence/mapper/memfile_v1_serializer.h> #include <vespa/memfilepersistence/mapper/memfile_v1_verifier.h> -#include <vespa/memfilepersistence/mapper/fileinfo.h> -#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h> #include <tests/spi/memfiletestutils.h> -#include <vespa/vdstestlib/cppunit/macros.h> -#include <tests/spi/simulatedfailurefile.h> namespace storage { namespace memfile { diff --git a/memfilepersistence/src/tests/spi/providerconformancetest.cpp b/memfilepersistence/src/tests/spi/providerconformancetest.cpp index 8bc2237265b..f85d6e0b872 100644 --- a/memfilepersistence/src/tests/spi/providerconformancetest.cpp +++ b/memfilepersistence/src/tests/spi/providerconformancetest.cpp @@ -1,19 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -#include <vespa/vdstestlib/cppunit/macros.h> +#include "memfiletestutils.h" #include <vespa/persistence/conformancetest/conformancetest.h> -#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h> -#include <vespa/storageframework/defaultimplementation/clock/realclock.h> -#include <vespa/storageframework/defaultimplementation/memory/memorymanager.h> #include <vespa/storageframework/defaultimplementation/memory/simplememorylogic.h> -#include <vespa/storageframework/generic/memory/memorymanagerinterface.h> -#include <vespa/memfilepersistence/memfile/memfilecache.h> -#include <vespa/memfilepersistence/spi/memfilepersistenceprovider.h> -#include <tests/spi/memfiletestutils.h> - -LOG_SETUP(".test.dummyimpl"); namespace storage { namespace memfile { diff --git a/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp b/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp index fbf7badf5e4..fa15cff67fd 100644 --- a/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp +++ b/memfilepersistence/src/tests/spi/shared_data_location_tracker_test.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/vdstestlib/cppunit/macros.h> #include <vespa/memfilepersistence/memfile/shared_data_location_tracker.h> diff --git a/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp b/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp index ffe7972552f..cb1bc057705 100644 --- a/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp +++ b/memfilepersistence/src/tests/spi/simplememfileiobuffertest.cpp @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h> -#include <vespa/vdstestlib/cppunit/macros.h> #include <tests/spi/memfiletestutils.h> #include <tests/spi/options_builder.h> @@ -51,19 +50,15 @@ class SimpleMemFileIOBufferTest : public SingleDiskMemFileTestUtils public: class DummyFileReader : public VersionSerializer { public: - virtual FileVersion getFileVersion() override { return FileVersion(); } - virtual void loadFile(MemFile&, Environment&, Buffer&, uint64_t ) override {} - virtual FlushResult flushUpdatesToFile(MemFile&, Environment&) override { + FileVersion getFileVersion() override { return FileVersion(); } + void loadFile(MemFile&, Environment&, Buffer&, uint64_t ) override {} + FlushResult flushUpdatesToFile(MemFile&, Environment&) override { return FlushResult::TooSmall; } - virtual void rewriteFile(MemFile&, Environment&) override {} - virtual bool verify(MemFile&, Environment&, - std::ostream&, bool, uint16_t) override { return false; }; - virtual void cacheLocations(MemFileIOInterface&, - Environment&, - const Options&, - DocumentPart, - const std::vector<DataLocation>&) override {} + void rewriteFile(MemFile&, Environment&) override {} + bool verify(MemFile&, Environment&, std::ostream&, bool, uint16_t) override { return false; }; + void cacheLocations(MemFileIOInterface&, Environment&, const Options&, + DocumentPart, const std::vector<DataLocation>&) override {} }; DummyFileReader dfr; diff --git a/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp b/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp index 75eab5c2972..e1c87dd1cf3 100644 --- a/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp +++ b/memfilepersistence/src/tests/spi/splitoperationhandlertest.cpp @@ -1,10 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> +#include "memfiletestutils.h" #include <vespa/document/datatype/documenttype.h> -#include <tests/spi/memfiletestutils.h> -#include <tests/spi/simulatedfailurefile.h> -#include <vespa/vdstestlib/cppunit/macros.h> using document::DocumentType; |