Skip to content

Commit

Permalink
enable test_storage for mmapped files on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Aug 14, 2022
1 parent 12daf28 commit c0e9679
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/test_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ template <typename StorageType>
std::shared_ptr<StorageType> make_storage(storage_params const& p
, aux::file_view_pool& fp);

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
template <>
std::shared_ptr<mmap_storage> make_storage(storage_params const& p
, aux::file_view_pool& fp)
Expand Down Expand Up @@ -250,7 +250,7 @@ std::shared_ptr<StorageType> setup_torrent(file_storage& fs
return s;
}

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
int write(std::shared_ptr<mmap_storage> s
, aux::session_settings const& sett
, span<char> buf
Expand Down Expand Up @@ -675,7 +675,7 @@ void run_test()
delete_dirs("temp_storage");
}

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
TORRENT_TEST(check_files_sparse_mmap)
{
test_check_files(sparse | zero_prio, lt::mmap_disk_io_constructor);
Expand Down Expand Up @@ -718,7 +718,7 @@ TORRENT_TEST(check_files_allocate_posix)
test_check_files(zero_prio, lt::posix_disk_io_constructor);
}

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
TORRENT_TEST(rename_mmap_disk_io)
{
test_rename<mmap_storage>(current_working_directory());
Expand Down Expand Up @@ -1084,7 +1084,7 @@ bool check_pattern(std::vector<char> const& buf, int counter)

} // anonymous namespace

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
TORRENT_TEST(mmap_disk_io) { run_test<mmap_storage>(); }
#endif
TORRENT_TEST(posix_disk_io) { run_test<posix_storage>(); }
Expand Down Expand Up @@ -1369,7 +1369,7 @@ void test_move_storage_into_self()
, combine_path("_folder3", "test4.tmp")))));
}

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
TORRENT_TEST(move_default_storage_to_self)
{
test_move_storage_to_self<mmap_storage>();
Expand Down Expand Up @@ -1404,7 +1404,7 @@ TORRENT_TEST(storage_paths_string_pooling)
TEST_CHECK(file_storage.paths().size() <= 2);
}

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
TORRENT_TEST(dont_move_intermingled_files)
{
std::string const save_path = complete("save_path_1");
Expand Down Expand Up @@ -1648,7 +1648,7 @@ void none_from_store_buffer(lt::disk_interface* disk_io, lt::storage_holder cons

}

#if TORRENT_HAVE_MMAP
#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE
TORRENT_TEST(mmap_unaligned_read_both_store_buffer)
{
test_unaligned_read(lt::mmap_disk_io_constructor, both_sides_from_store_buffer);
Expand Down

0 comments on commit c0e9679

Please sign in to comment.