diff --git a/Makefile.am b/Makefile.am index 12ab3565e..4cdd86b46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,7 +70,7 @@ test_libbitcoin_database_test_SOURCES = \ test/locks/flush_lock.cpp \ test/locks/interprocess_lock.cpp \ test/memory/accessor.cpp \ - test/memory/map.cpp \ + test/memory/mmap.cpp \ test/memory/utilities.cpp \ test/mocks/blocks.cpp \ test/mocks/blocks.hpp \ @@ -207,10 +207,10 @@ include_bitcoin_database_file_HEADERS = \ include_bitcoin_database_impl_memorydir = ${includedir}/bitcoin/database/impl/memory include_bitcoin_database_impl_memory_HEADERS = \ include/bitcoin/database/impl/memory/accessor.ipp \ - include/bitcoin/database/impl/memory/map.ipp \ - include/bitcoin/database/impl/memory/map_dispatch.ipp \ - include/bitcoin/database/impl/memory/map_private.ipp \ - include/bitcoin/database/impl/memory/map_storage.ipp + include/bitcoin/database/impl/memory/mmap.ipp \ + include/bitcoin/database/impl/memory/mmap_dispatch.ipp \ + include/bitcoin/database/impl/memory/mmap_private.ipp \ + include/bitcoin/database/impl/memory/mmap_storage.ipp include_bitcoin_database_impl_primitivesdir = ${includedir}/bitcoin/database/impl/primitives include_bitcoin_database_impl_primitives_HEADERS = \ @@ -313,10 +313,10 @@ include_bitcoin_database_memorydir = ${includedir}/bitcoin/database/memory include_bitcoin_database_memory_HEADERS = \ include/bitcoin/database/memory/accessor.hpp \ include/bitcoin/database/memory/finalizer.hpp \ - include/bitcoin/database/memory/map.hpp \ include/bitcoin/database/memory/maps.hpp \ include/bitcoin/database/memory/memory.hpp \ include/bitcoin/database/memory/mman.hpp \ + include/bitcoin/database/memory/mmap.hpp \ include/bitcoin/database/memory/reader.hpp \ include/bitcoin/database/memory/streamers.hpp \ include/bitcoin/database/memory/utilities.hpp diff --git a/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj b/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj index 27628105b..0c048ca25 100644 --- a/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj +++ b/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj @@ -128,7 +128,7 @@ - + $(IntDir)test_memory_utilities.obj diff --git a/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters b/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters index b0371141f..7696c6c34 100644 --- a/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters +++ b/builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters @@ -90,7 +90,7 @@ src\memory - + src\memory diff --git a/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj b/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj index aab855d3a..581c581de 100644 --- a/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj +++ b/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj @@ -155,10 +155,10 @@ - + @@ -222,10 +222,10 @@ - - - - + + + + diff --git a/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj.filters b/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj.filters index 657e77058..b8cac1d60 100644 --- a/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj.filters +++ b/builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj.filters @@ -182,9 +182,6 @@ include\bitcoin\database\memory\interfaces - - include\bitcoin\database\memory - include\bitcoin\database\memory @@ -194,6 +191,9 @@ include\bitcoin\database\memory + + include\bitcoin\database\memory + include\bitcoin\database\memory @@ -379,16 +379,16 @@ include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory diff --git a/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj b/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj index d6482d663..06284fa82 100644 --- a/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj +++ b/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj @@ -128,7 +128,7 @@ - + $(IntDir)test_memory_utilities.obj diff --git a/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters b/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters index b0371141f..7696c6c34 100644 --- a/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters +++ b/builds/msvc/vs2026/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters @@ -90,7 +90,7 @@ src\memory - + src\memory diff --git a/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj b/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj index f3c730059..07bb02cde 100644 --- a/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj +++ b/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj @@ -155,10 +155,10 @@ - + @@ -222,10 +222,10 @@ - - - - + + + + diff --git a/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj.filters b/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj.filters index 657e77058..b8cac1d60 100644 --- a/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj.filters +++ b/builds/msvc/vs2026/libbitcoin-database/libbitcoin-database.vcxproj.filters @@ -182,9 +182,6 @@ include\bitcoin\database\memory\interfaces - - include\bitcoin\database\memory - include\bitcoin\database\memory @@ -194,6 +191,9 @@ include\bitcoin\database\memory + + include\bitcoin\database\memory + include\bitcoin\database\memory @@ -379,16 +379,16 @@ include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory - + include\bitcoin\database\impl\memory diff --git a/include/bitcoin/database.hpp b/include/bitcoin/database.hpp index 6f1e7729f..55187bb95 100644 --- a/include/bitcoin/database.hpp +++ b/include/bitcoin/database.hpp @@ -31,10 +31,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/include/bitcoin/database/impl/memory/map.ipp b/include/bitcoin/database/impl/memory/mmap.ipp similarity index 89% rename from include/bitcoin/database/impl/memory/map.ipp rename to include/bitcoin/database/impl/memory/mmap.ipp index c499ecb58..2e627a3d6 100644 --- a/include/bitcoin/database/impl/memory/map.ipp +++ b/include/bitcoin/database/impl/memory/mmap.ipp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#ifndef LIBBITCOIN_DATABASE_MEMORY_MAP_IPP -#define LIBBITCOIN_DATABASE_MEMORY_MAP_IPP +#ifndef LIBBITCOIN_DATABASE_MEMORY_MMAP_IPP +#define LIBBITCOIN_DATABASE_MEMORY_MMAP_IPP #include #include @@ -32,7 +32,7 @@ namespace database { // ---------------------------------------------------------------------------- TEMPLATE -CLASS::map1(const path& filename, size_t minimum, size_t expansion, +CLASS::mmap(const path& filename, size_t minimum, size_t expansion, bool random) NOEXCEPT requires (columns == one) : filenames_{ filename }, @@ -44,7 +44,7 @@ CLASS::map1(const path& filename, size_t minimum, size_t expansion, } TEMPLATE -CLASS::map1(const paths& filenames, size_t minimum, size_t expansion, +CLASS::mmap(const paths& filenames, size_t minimum, size_t expansion, bool random) NOEXCEPT requires (columns > one) : filenames_(filenames), @@ -57,7 +57,7 @@ CLASS::map1(const paths& filenames, size_t minimum, size_t expansion, } TEMPLATE -CLASS::~map1() NOEXCEPT +CLASS::~mmap() NOEXCEPT { BC_ASSERT_MSG(!loaded_, "..."); BC_ASSERT_MSG(is_zero(logical_), "..."); @@ -76,10 +76,7 @@ TEMPLATE bool CLASS::is_open() const NOEXCEPT { std::shared_lock field_lock(field_mutex_); - return std::ranges::any_of(opened_, [](auto opened) NOEXCEPT - { - return opened != file::invalid; - }); + return opened_.front() != file::invalid; } TEMPLATE diff --git a/include/bitcoin/database/impl/memory/map_dispatch.ipp b/include/bitcoin/database/impl/memory/mmap_dispatch.ipp similarity index 97% rename from include/bitcoin/database/impl/memory/map_dispatch.ipp rename to include/bitcoin/database/impl/memory/mmap_dispatch.ipp index 52e253c59..ac4356a17 100644 --- a/include/bitcoin/database/impl/memory/map_dispatch.ipp +++ b/include/bitcoin/database/impl/memory/mmap_dispatch.ipp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#ifndef LIBBITCOIN_DATABASE_MEMORY_MAP_DISPATCH_IPP -#define LIBBITCOIN_DATABASE_MEMORY_MAP_DISPATCH_IPP +#ifndef LIBBITCOIN_DATABASE_MEMORY_MMAP_DISPATCH_IPP +#define LIBBITCOIN_DATABASE_MEMORY_MMAP_DISPATCH_IPP #include #include diff --git a/include/bitcoin/database/impl/memory/map_private.ipp b/include/bitcoin/database/impl/memory/mmap_private.ipp similarity index 98% rename from include/bitcoin/database/impl/memory/map_private.ipp rename to include/bitcoin/database/impl/memory/mmap_private.ipp index 697a8590c..104ba85e3 100644 --- a/include/bitcoin/database/impl/memory/map_private.ipp +++ b/include/bitcoin/database/impl/memory/mmap_private.ipp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#ifndef LIBBITCOIN_DATABASE_MEMORY_MAP_PRIVATE_IPP -#define LIBBITCOIN_DATABASE_MEMORY_MAP_PRIVATE_IPP +#ifndef LIBBITCOIN_DATABASE_MEMORY_MMAP_PRIVATE_IPP +#define LIBBITCOIN_DATABASE_MEMORY_MMAP_PRIVATE_IPP #include #include diff --git a/include/bitcoin/database/impl/memory/map_storage.ipp b/include/bitcoin/database/impl/memory/mmap_storage.ipp similarity index 97% rename from include/bitcoin/database/impl/memory/map_storage.ipp rename to include/bitcoin/database/impl/memory/mmap_storage.ipp index 6d083ef1f..dadfdefae 100644 --- a/include/bitcoin/database/impl/memory/map_storage.ipp +++ b/include/bitcoin/database/impl/memory/mmap_storage.ipp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#ifndef LIBBITCOIN_DATABASE_MEMORY_MAP_STORAGE_IPP -#define LIBBITCOIN_DATABASE_MEMORY_MAP_STORAGE_IPP +#ifndef LIBBITCOIN_DATABASE_MEMORY_MMAP_STORAGE_IPP +#define LIBBITCOIN_DATABASE_MEMORY_MMAP_STORAGE_IPP #include #include @@ -69,7 +69,7 @@ code CLASS::open() NOEXCEPT { std::unique_lock field_lock(field_mutex_); - for (const auto& descriptor : opened_) + for (const auto& descriptor: opened_) if (descriptor != file::invalid) return error::open_open; @@ -97,12 +97,11 @@ code CLASS::close() NOEXCEPT if (loaded_) return error::close_loaded; - for (const auto& descriptor: opened_) - if (descriptor == file::invalid) - return error::success; + if (opened_.front() == file::invalid) + return error::success; logical_ = zero; - for (auto& descriptor : opened_) + for (auto& descriptor: opened_) { if (descriptor != file::invalid) { diff --git a/include/bitcoin/database/memory/maps.hpp b/include/bitcoin/database/memory/maps.hpp index 790ea6207..998448c27 100644 --- a/include/bitcoin/database/memory/maps.hpp +++ b/include/bitcoin/database/memory/maps.hpp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#ifndef LIBBITCOIN_DATABASE_MEMORY_MAPS_HPP -#define LIBBITCOIN_DATABASE_MEMORY_MAPS_HPP +#ifndef LIBBITCOIN_DATABASE_MEMORY_MMAPS_HPP +#define LIBBITCOIN_DATABASE_MEMORY_MMAPS_HPP #include #include diff --git a/include/bitcoin/database/memory/memory.hpp b/include/bitcoin/database/memory/memory.hpp index 43d4f617b..d5030c843 100644 --- a/include/bitcoin/database/memory/memory.hpp +++ b/include/bitcoin/database/memory/memory.hpp @@ -23,9 +23,9 @@ #include #include #include -#include #include #include +#include #include #endif diff --git a/include/bitcoin/database/memory/map.hpp b/include/bitcoin/database/memory/mmap.hpp similarity index 94% rename from include/bitcoin/database/memory/map.hpp rename to include/bitcoin/database/memory/mmap.hpp index 830977750..2518a4652 100644 --- a/include/bitcoin/database/memory/map.hpp +++ b/include/bitcoin/database/memory/mmap.hpp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -#ifndef LIBBITCOIN_DATABASE_MEMORY_MAP_HPP -#define LIBBITCOIN_DATABASE_MEMORY_MAP_HPP +#ifndef LIBBITCOIN_DATABASE_MEMORY_MMAP_HPP +#define LIBBITCOIN_DATABASE_MEMORY_MMAP_HPP #include #include @@ -36,11 +36,11 @@ namespace database { /// Thread safe access to a memory-mapped file, or to a set of column files /// sharing one allocation/remap guard set (SoA aggregate). template -class map1 +class mmap : public storage { public: - DELETE_COPY_MOVE(map1); + DELETE_COPY_MOVE(mmap); /// Number of backing columns (1 == scalar map). static constexpr size_t columns = sizeof...(Widths); @@ -76,17 +76,17 @@ class map1 /// ----------------------------------------------------------------------- /// Scalar construction (columns == 1): unchanged signature and codegen. - map1(const std::filesystem::path& filename, size_t minimum=1, + mmap(const std::filesystem::path& filename, size_t minimum=1, size_t expansion=0, bool random=true) NOEXCEPT requires (columns == one); /// Aggregate construction (columns > 1): one file per column, shared guards. - map1(const paths& filenames, size_t minimum=1, size_t expansion=0, + mmap(const paths& filenames, size_t minimum=1, size_t expansion=0, bool random=true) NOEXCEPT requires (columns > one); /// Destruct for debug assertion only. - virtual ~map1() NOEXCEPT; + virtual ~mmap() NOEXCEPT; /// True if the file(s) are open. bool is_open() const NOEXCEPT; @@ -243,20 +243,20 @@ class map1 /// Scalar map: single column, width 1. Source and codegen identical to the /// prior non-aggregate map; existing usage binds the unchanged constructor. -using map = map1<1>; +using map = mmap<1>; } // namespace database } // namespace libbitcoin #define TEMPLATE template -#define CLASS map1 +#define CLASS mmap BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) -#include -#include -#include -#include +#include +#include +#include +#include BC_POP_WARNING() diff --git a/test/memory/map.cpp b/test/memory/mmap.cpp similarity index 90% rename from test/memory/map.cpp rename to test/memory/mmap.cpp index 372144345..e4aac17a1 100644 --- a/test/memory/map.cpp +++ b/test/memory/mmap.cpp @@ -22,9 +22,11 @@ // error::load_failure, error::flush_failure, error::unload_failure codes, but // don't want to make this class virtual. -BOOST_FIXTURE_TEST_SUITE(map_tests, test::directory_setup_fixture) +BOOST_FIXTURE_TEST_SUITE(mmap_tests, test::directory_setup_fixture) -BOOST_AUTO_TEST_CASE(map__file__always__expected) +// map is an alias for mmap<1>. + +BOOST_AUTO_TEST_CASE(mmap__file__always__expected) { const std::string file = TEST_PATH; map instance(file); @@ -32,7 +34,7 @@ BOOST_AUTO_TEST_CASE(map__file__always__expected) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__open__opened__open_open) +BOOST_AUTO_TEST_CASE(mmap__open__opened__open_open) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -45,7 +47,7 @@ BOOST_AUTO_TEST_CASE(map__open__opened__open_open) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__open__no_file__false) +BOOST_AUTO_TEST_CASE(mmap__open__no_file__false) { const std::string file = TEST_PATH; map instance(file); @@ -55,7 +57,7 @@ BOOST_AUTO_TEST_CASE(map__open__no_file__false) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__close__open__true) +BOOST_AUTO_TEST_CASE(mmap__close__open__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -67,7 +69,7 @@ BOOST_AUTO_TEST_CASE(map__close__open__true) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__close__closed__true) +BOOST_AUTO_TEST_CASE(mmap__close__closed__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -77,7 +79,7 @@ BOOST_AUTO_TEST_CASE(map__close__closed__true) BOOST_REQUIRE(!instance.close()); } -BOOST_AUTO_TEST_CASE(map__close__loaded__close_loaded) +BOOST_AUTO_TEST_CASE(mmap__close__loaded__close_loaded) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -91,7 +93,7 @@ BOOST_AUTO_TEST_CASE(map__close__loaded__close_loaded) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__properties__open_close__expected) +BOOST_AUTO_TEST_CASE(mmap__properties__open_close__expected) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -118,7 +120,7 @@ BOOST_AUTO_TEST_CASE(map__properties__open_close__expected) BOOST_REQUIRE(test::exists(file)); } -BOOST_AUTO_TEST_CASE(map__properties__load_unload__expected) +BOOST_AUTO_TEST_CASE(mmap__properties__load_unload__expected) { constexpr auto default_minimum_capacity = 1u; const std::string file = TEST_PATH; @@ -150,7 +152,7 @@ BOOST_AUTO_TEST_CASE(map__properties__load_unload__expected) BOOST_REQUIRE(test::exists(file)); } -BOOST_AUTO_TEST_CASE(map__load__unloaded__true) +BOOST_AUTO_TEST_CASE(mmap__load__unloaded__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -162,7 +164,7 @@ BOOST_AUTO_TEST_CASE(map__load__unloaded__true) BOOST_REQUIRE(!instance.close()); BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__load__shared__load_locked) +BOOST_AUTO_TEST_CASE(mmap__load__shared__load_locked) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -181,7 +183,7 @@ BOOST_AUTO_TEST_CASE(map__load__shared__load_locked) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__load__loaded__load_loaded) +BOOST_AUTO_TEST_CASE(mmap__load__loaded__load_loaded) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -195,7 +197,7 @@ BOOST_AUTO_TEST_CASE(map__load__loaded__load_loaded) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__unload__unloaded__true) +BOOST_AUTO_TEST_CASE(mmap__unload__unloaded__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -207,7 +209,7 @@ BOOST_AUTO_TEST_CASE(map__unload__unloaded__true) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__unload__loaded__true) +BOOST_AUTO_TEST_CASE(mmap__unload__loaded__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -220,7 +222,7 @@ BOOST_AUTO_TEST_CASE(map__unload__loaded__true) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__shrink__unloaded__shrink_unloaded) +BOOST_AUTO_TEST_CASE(mmap__shrink__unloaded__shrink_unloaded) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -232,7 +234,7 @@ BOOST_AUTO_TEST_CASE(map__shrink__unloaded__shrink_unloaded) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__shrink__loaded__true) +BOOST_AUTO_TEST_CASE(mmap__shrink__loaded__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -246,7 +248,7 @@ BOOST_AUTO_TEST_CASE(map__shrink__loaded__true) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__capacity__default__expected) +BOOST_AUTO_TEST_CASE(mmap__capacity__default__expected) { constexpr auto default_minimum_capacity = 1_size; @@ -263,7 +265,7 @@ BOOST_AUTO_TEST_CASE(map__capacity__default__expected) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__allocate__unloaded__false) +BOOST_AUTO_TEST_CASE(mmap__allocate__unloaded__false) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -275,7 +277,7 @@ BOOST_AUTO_TEST_CASE(map__allocate__unloaded__false) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__allocate__loaded__expected_capacity) +BOOST_AUTO_TEST_CASE(mmap__allocate__loaded__expected_capacity) { constexpr auto half_rate = 50_size; constexpr auto minimum = 42_size; @@ -296,7 +298,7 @@ BOOST_AUTO_TEST_CASE(map__allocate__loaded__expected_capacity) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__allocate__add_overflow__eof) +BOOST_AUTO_TEST_CASE(mmap__allocate__add_overflow__eof) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -311,7 +313,7 @@ BOOST_AUTO_TEST_CASE(map__allocate__add_overflow__eof) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__allocate__minimum_no_expansion__expected_capacity) +BOOST_AUTO_TEST_CASE(mmap__allocate__minimum_no_expansion__expected_capacity) { constexpr auto size = 42_size; constexpr auto minimum = 100_size; @@ -330,7 +332,7 @@ BOOST_AUTO_TEST_CASE(map__allocate__minimum_no_expansion__expected_capacity) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__allocate__no_minimum_expansion__expected_capacity) +BOOST_AUTO_TEST_CASE(mmap__allocate__no_minimum_expansion__expected_capacity) { // map will fail if minimum is zero. constexpr auto minimum = 1_size; @@ -352,7 +354,7 @@ BOOST_AUTO_TEST_CASE(map__allocate__no_minimum_expansion__expected_capacity) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__truncate__unloaded__failure) +BOOST_AUTO_TEST_CASE(mmap__truncate__unloaded__failure) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -364,7 +366,7 @@ BOOST_AUTO_TEST_CASE(map__truncate__unloaded__failure) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__truncate__default_to_zero__success) +BOOST_AUTO_TEST_CASE(mmap__truncate__default_to_zero__success) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -378,7 +380,7 @@ BOOST_AUTO_TEST_CASE(map__truncate__default_to_zero__success) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__truncate__increase_capacity__failure) +BOOST_AUTO_TEST_CASE(mmap__truncate__increase_capacity__failure) { constexpr auto half_rate = 50_size; constexpr auto minimum = 42_size; @@ -396,7 +398,7 @@ BOOST_AUTO_TEST_CASE(map__truncate__increase_capacity__failure) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__truncate__unchanged__success_capacity_unchanged) +BOOST_AUTO_TEST_CASE(mmap__truncate__unchanged__success_capacity_unchanged) { constexpr auto half_rate = 50_size; constexpr auto minimum = 42_size; @@ -416,7 +418,7 @@ BOOST_AUTO_TEST_CASE(map__truncate__unchanged__success_capacity_unchanged) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__truncate__decrease__success_logical_decreased_capacity_unchanged) +BOOST_AUTO_TEST_CASE(mmap__truncate__decrease__success_logical_decreased_capacity_unchanged) { constexpr auto half_rate = 50_size; constexpr auto minimum = 42_size; @@ -438,7 +440,7 @@ BOOST_AUTO_TEST_CASE(map__truncate__decrease__success_logical_decreased_capacity BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__set__unloaded__false) +BOOST_AUTO_TEST_CASE(mmap__set__unloaded__false) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -449,7 +451,7 @@ BOOST_AUTO_TEST_CASE(map__set__unloaded__false) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__set__loaded__expected_capacity) +BOOST_AUTO_TEST_CASE(mmap__set__loaded__expected_capacity) { constexpr auto half_rate = 50_size; constexpr auto minimum = 42_size; @@ -480,7 +482,7 @@ BOOST_AUTO_TEST_CASE(map__set__loaded__expected_capacity) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__set__add_overflow__eof) +BOOST_AUTO_TEST_CASE(mmap__set__add_overflow__eof) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -495,7 +497,7 @@ BOOST_AUTO_TEST_CASE(map__set__add_overflow__eof) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__set__minimum_no_expansion__expected_capacity) +BOOST_AUTO_TEST_CASE(mmap__set__minimum_no_expansion__expected_capacity) { constexpr auto rate = 0_size; constexpr auto minimum = 42_size; @@ -517,7 +519,7 @@ BOOST_AUTO_TEST_CASE(map__set__minimum_no_expansion__expected_capacity) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__set__no_minimum_expansion__expected_capacity) +BOOST_AUTO_TEST_CASE(mmap__set__no_minimum_expansion__expected_capacity) { // map will fail if minimum is zero. constexpr auto rate = 42_size; @@ -541,7 +543,7 @@ BOOST_AUTO_TEST_CASE(map__set__no_minimum_expansion__expected_capacity) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__set__loaded__expected_fill) +BOOST_AUTO_TEST_CASE(mmap__set__loaded__expected_fill) { BC_PUSH_WARNING(NO_POINTER_ARITHMETIC) @@ -642,7 +644,7 @@ BOOST_AUTO_TEST_CASE(map__set__loaded__expected_fill) BC_POP_WARNING() } -BOOST_AUTO_TEST_CASE(map__get__unloaded__false) +BOOST_AUTO_TEST_CASE(mmap__get__unloaded__false) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -654,7 +656,7 @@ BOOST_AUTO_TEST_CASE(map__get__unloaded__false) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__get__loaded__success) +BOOST_AUTO_TEST_CASE(mmap__get__loaded__success) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -668,7 +670,7 @@ BOOST_AUTO_TEST_CASE(map__get__loaded__success) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__get__size__expected) +BOOST_AUTO_TEST_CASE(mmap__get__size__expected) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -689,7 +691,7 @@ BOOST_AUTO_TEST_CASE(map__get__size__expected) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__get_capacity__size__expected) +BOOST_AUTO_TEST_CASE(mmap__get_capacity__size__expected) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -710,7 +712,7 @@ BOOST_AUTO_TEST_CASE(map__get_capacity__size__expected) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__get_raw__always__nonblocking) +BOOST_AUTO_TEST_CASE(mmap__get_raw__always__nonblocking) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -730,7 +732,7 @@ BOOST_AUTO_TEST_CASE(map__get_raw__always__nonblocking) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__flush__unloaded__flush_unloaded) +BOOST_AUTO_TEST_CASE(mmap__flush__unloaded__flush_unloaded) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -742,7 +744,7 @@ BOOST_AUTO_TEST_CASE(map__flush__unloaded__flush_unloaded) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__flush__loaded__true) +BOOST_AUTO_TEST_CASE(mmap__flush__loaded__true) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file)); @@ -756,7 +758,7 @@ BOOST_AUTO_TEST_CASE(map__flush__loaded__true) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__write__read__expected) +BOOST_AUTO_TEST_CASE(mmap__write__read__expected) { constexpr uint64_t expected = 0x0102030405060708_u64; const std::string file = TEST_PATH; @@ -783,7 +785,7 @@ BOOST_AUTO_TEST_CASE(map__write__read__expected) BOOST_REQUIRE(!instance.get_fault()); } -BOOST_AUTO_TEST_CASE(map__unload__shared__unload_locked) +BOOST_AUTO_TEST_CASE(mmap__unload__shared__unload_locked) { const std::string file = TEST_PATH; BOOST_REQUIRE(test::create(file));