Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-10-17 21:23:18 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-10-17 21:23:18 +0300
commitfd12a60d26c80d93185ff0e0da1efa4ddbbf3863 (patch)
treecd4f6676380acf8f5d394494e6b1def7e243e8a8 /test
parentbc1a0df70b896bc5b1852e8281aced96596b27af (diff)
Lots of changes to support latest WG21 SG14 status code, as the erased code is now move-only, which in turn requires the async i/o completion handlers to all use rvalue refs instead of lvalue refs. This helped find and fix a fair few inefficient corner cases along the way, which is great.
Diffstat (limited to 'test')
-rw-r--r--test/test_kernel_decl.hpp5
-rw-r--r--test/tests/async_io.cpp2
-rw-r--r--test/tests/directory_handle_create_close/runner.cpp12
-rw-r--r--test/tests/directory_handle_enumerate/runner.cpp2
-rw-r--r--test/tests/file_handle_create_close/runner.cpp6
-rw-r--r--test/tests/map_handle_create_close/runner.cpp2
-rw-r--r--test/tests/mapped.cpp2
-rw-r--r--test/tests/section_handle_create_close/runner.cpp2
-rw-r--r--test/tests/symlink_handle_create_close/runner.cpp10
9 files changed, 25 insertions, 18 deletions
diff --git a/test/test_kernel_decl.hpp b/test/test_kernel_decl.hpp
index afac7aa0..52f7c0af 100644
--- a/test/test_kernel_decl.hpp
+++ b/test/test_kernel_decl.hpp
@@ -37,6 +37,11 @@ Distributed under the Boost Software License, Version 1.0.
#if LLFIO_EXPERIMENTAL_STATUS_CODE
#define KERNELTEST_EXPERIMENTAL_STATUS_CODE 1
#include "outcome/include/outcome/experimental/status-code/include/iostream_support.hpp"
+
+// Used for initialiser list stored results as the erased form is move-only
+template <class T> using il_result = OUTCOME_V2_NAMESPACE::experimental::status_result<T, typename SYSTEM_ERROR2_NAMESPACE::generic_code::domain_type>;
+#else
+template <class T> using il_result = LLFIO_V2_NAMESPACE::result<T>;
#endif
#include "kerneltest/include/kerneltest.hpp"
diff --git a/test/tests/async_io.cpp b/test/tests/async_io.cpp
index 1dc07ffb..9f1ef546 100644
--- a/test/tests/async_io.cpp
+++ b/test/tests/async_io.cpp
@@ -43,7 +43,7 @@ static inline void TestAsyncFileHandle()
std::promise<llfio::async_file_handle::const_buffers_type> p;
auto f(p.get_future());
auto schedule_io = [&] {
- return h.async_write({bt, n * 4096}, [ p = std::move(p), n ](llfio::async_file_handle *, llfio::async_file_handle::io_result<llfio::async_file_handle::const_buffers_type> & result) mutable {
+ return h.async_write({bt, n * 4096}, [ p = std::move(p), n ](llfio::async_file_handle *, llfio::async_file_handle::io_result<llfio::async_file_handle::const_buffers_type> && result) mutable {
(void) n;
if(!result && result.error() == llfio::errc::resource_unavailable_try_again)
{
diff --git a/test/tests/directory_handle_create_close/runner.cpp b/test/tests/directory_handle_create_close/runner.cpp
index 758f485d..7ae0179b 100644
--- a/test/tests/directory_handle_create_close/runner.cpp
+++ b/test/tests/directory_handle_create_close/runner.cpp
@@ -29,17 +29,17 @@ template <class U> inline void directory_handle_create_close_creation(U &&f)
using namespace KERNELTEST_V1_NAMESPACE;
using LLFIO_V2_NAMESPACE::result;
using directory_handle = LLFIO_V2_NAMESPACE::directory_handle;
- static const result<void> no_such_file_or_directory = LLFIO_V2_NAMESPACE::errc::no_such_file_or_directory;
- static const result<void> file_exists = LLFIO_V2_NAMESPACE::errc::file_exists;
- static const result<void> is_a_directory = LLFIO_V2_NAMESPACE::errc::is_a_directory;
- static const result<void> permission_denied = LLFIO_V2_NAMESPACE::errc::permission_denied;
+ static const il_result<void> no_such_file_or_directory = LLFIO_V2_NAMESPACE::errc::no_such_file_or_directory;
+ static const il_result<void> file_exists = LLFIO_V2_NAMESPACE::errc::file_exists;
+ static const il_result<void> is_a_directory = LLFIO_V2_NAMESPACE::errc::is_a_directory;
+ static const il_result<void> permission_denied = LLFIO_V2_NAMESPACE::errc::permission_denied;
// clang-format off
static typename directory_handle::buffer_type _entries[5];
static typename directory_handle::buffers_type entries(_entries);
static result<typename directory_handle::buffers_type> info(typename result<typename directory_handle::buffers_type>::error_type{});
static const auto permuter(mt_permute_parameters<
- result<void>,
+ il_result<void>,
parameters<
typename directory_handle::mode,
typename directory_handle::creation,
@@ -49,7 +49,7 @@ template <class U> inline void directory_handle_create_close_creation(U &&f)
>,
precondition::filesystem_setup_parameters,
postcondition::filesystem_comparison_structure_parameters,
- postcondition::custom_parameters<result<void>>
+ postcondition::custom_parameters<il_result<void>>
>(
{
diff --git a/test/tests/directory_handle_enumerate/runner.cpp b/test/tests/directory_handle_enumerate/runner.cpp
index 4ab1d872..57400134 100644
--- a/test/tests/directory_handle_enumerate/runner.cpp
+++ b/test/tests/directory_handle_enumerate/runner.cpp
@@ -38,7 +38,7 @@ template <class U> inline void directory_handle_enumerate_(U &&f)
// clang-format off
static const auto permuter(mt_permute_parameters<
- result<void>,
+ il_result<void>,
parameters<
LLFIO_V2_NAMESPACE::span<directory_entry> *,
path_view,
diff --git a/test/tests/file_handle_create_close/runner.cpp b/test/tests/file_handle_create_close/runner.cpp
index e33b0c09..d2ec684d 100644
--- a/test/tests/file_handle_create_close/runner.cpp
+++ b/test/tests/file_handle_create_close/runner.cpp
@@ -30,8 +30,8 @@ template <class U> inline void file_handle_create_close_creation(U &&f)
using namespace KERNELTEST_V1_NAMESPACE;
using LLFIO_V2_NAMESPACE::result;
using file_handle = LLFIO_V2_NAMESPACE::file_handle;
- static const result<void> no_such_file_or_directory = LLFIO_V2_NAMESPACE::errc::no_such_file_or_directory;
- static const result<void> file_exists = LLFIO_V2_NAMESPACE::errc::file_exists;
+ static const il_result<void> no_such_file_or_directory = LLFIO_V2_NAMESPACE::errc::no_such_file_or_directory;
+ static const il_result<void> file_exists = LLFIO_V2_NAMESPACE::errc::file_exists;
/* Set up a permuter which for every one of these parameter values listed,
tests with the value using the input workspace which should produce outcome
@@ -42,7 +42,7 @@ template <class U> inline void file_handle_create_close_creation(U &&f)
*/
// clang-format off
static const auto permuter(mt_permute_parameters< // This is a multithreaded parameter permutation test
- result<void>, // The output outcome/result/option type. Type void means we don't care about the return type.
+ il_result<void>, // The output outcome/result/option type. Type void means we don't care about the return type.
parameters< // The types of one or more input parameters to permute/fuzz the kernel with.
typename file_handle::mode,
typename file_handle::creation,
diff --git a/test/tests/map_handle_create_close/runner.cpp b/test/tests/map_handle_create_close/runner.cpp
index 41e2ec71..bf6dcd7e 100644
--- a/test/tests/map_handle_create_close/runner.cpp
+++ b/test/tests/map_handle_create_close/runner.cpp
@@ -38,7 +38,7 @@ template <class U> inline void map_handle_create_close_(U &&f)
// clang-format off
static const auto permuter(st_permute_parameters<
- result<void>,
+ il_result<void>,
parameters<
typename map_handle::size_type,
typename section_handle::flag
diff --git a/test/tests/mapped.cpp b/test/tests/mapped.cpp
index 4a3ca47b..69704714 100644
--- a/test/tests/mapped.cpp
+++ b/test/tests/mapped.cpp
@@ -102,11 +102,13 @@ static inline void TestMappedView2()
BOOST_CHECK(v1.size() == 2 * 1024 * 1024 / sizeof(int));
BOOST_CHECK(v1[0] == 78);
BOOST_CHECK(v1[9999] == 79);
+#ifndef _WIN32
// Microsoft WSL hasn't implemented the shrinking of open maps yet
if(utils::running_under_wsl())
{
return;
}
+#endif
mfh.truncate(1 * sizeof(int)).value();
BOOST_CHECK(mfh.address() != nullptr);
v1 = map_view<int>(mfh);
diff --git a/test/tests/section_handle_create_close/runner.cpp b/test/tests/section_handle_create_close/runner.cpp
index bcf19165..c3e3869a 100644
--- a/test/tests/section_handle_create_close/runner.cpp
+++ b/test/tests/section_handle_create_close/runner.cpp
@@ -37,7 +37,7 @@ template <class U> inline void section_handle_create_close_(U &&f)
// clang-format off
static const auto permuter(st_permute_parameters<
- result<void>,
+ il_result<void>,
parameters<
typename section_handle::extent_type,
typename section_handle::flag
diff --git a/test/tests/symlink_handle_create_close/runner.cpp b/test/tests/symlink_handle_create_close/runner.cpp
index b4a0b189..0a42aab2 100644
--- a/test/tests/symlink_handle_create_close/runner.cpp
+++ b/test/tests/symlink_handle_create_close/runner.cpp
@@ -29,16 +29,16 @@ template <class U> inline void symlink_handle_create_close_creation(U &&f)
using namespace KERNELTEST_V1_NAMESPACE;
using LLFIO_V2_NAMESPACE::result;
using symlink_handle = LLFIO_V2_NAMESPACE::symlink_handle;
- static const result<void> no_such_file_or_directory = LLFIO_V2_NAMESPACE::errc::no_such_file_or_directory;
- static const result<void> file_exists = LLFIO_V2_NAMESPACE::errc::file_exists;
- static const result<void> function_not_supported = LLFIO_V2_NAMESPACE::errc::function_not_supported;
- static const result<void> permission_denied = LLFIO_V2_NAMESPACE::errc::permission_denied;
+ static const il_result<void> no_such_file_or_directory = LLFIO_V2_NAMESPACE::errc::no_such_file_or_directory;
+ static const il_result<void> file_exists = LLFIO_V2_NAMESPACE::errc::file_exists;
+ static const il_result<void> function_not_supported = LLFIO_V2_NAMESPACE::errc::function_not_supported;
+ static const il_result<void> permission_denied = LLFIO_V2_NAMESPACE::errc::permission_denied;
assert(file_exists.error() == LLFIO_V2_NAMESPACE::errc::file_exists);
// clang-format off
static const auto permuter(mt_permute_parameters<
- result<void>,
+ il_result<void>,
parameters<
typename symlink_handle::mode,
typename symlink_handle::creation,