diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-07-14 23:40:31 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-07-14 23:40:31 +0300 |
commit | a7bc876322994d2bd76e95b2c61ec1b1241e4738 (patch) | |
tree | 9cc95beb4b84229155c7c05a9ee1ad5bb022ef2f /test/tests/file_handle_create_close | |
parent | 3a16fa3e45b940a221ceb41a6c86ebe214318c02 (diff) |
First attempt at a port to QuickCppLib and Outcome v2 (it's not working yet)
Diffstat (limited to 'test/tests/file_handle_create_close')
3 files changed, 13 insertions, 13 deletions
diff --git a/test/tests/file_handle_create_close/kernel_async_file_handle.cpp.hpp b/test/tests/file_handle_create_close/kernel_async_file_handle.cpp.hpp index 6716ae00..4274e082 100644 --- a/test/tests/file_handle_create_close/kernel_async_file_handle.cpp.hpp +++ b/test/tests/file_handle_create_close/kernel_async_file_handle.cpp.hpp @@ -26,12 +26,12 @@ Distributed under the Boost Software License, Version 1.0. namespace file_handle_create_close { - BOOST_AFIO_TEST_KERNEL_DECL boost::outcome::result<boost::afio::async_file_handle> test_kernel_async_file_handle(boost::afio::async_file_handle::mode m, boost::afio::async_file_handle::creation c, boost::afio::async_file_handle::flag f) + AFIO_TEST_KERNEL_DECL AFIO_V2_NAMESPACE::result<AFIO_V2_NAMESPACE::async_file_handle> test_kernel_async_file_handle(AFIO_V2_NAMESPACE::async_file_handle::mode m, AFIO_V2_NAMESPACE::async_file_handle::creation c, AFIO_V2_NAMESPACE::async_file_handle::flag f) { - boost::afio::io_service service; - auto h = boost::afio::async_file_handle::async_file(service, "testfile.txt", m, c, boost::afio::async_file_handle::caching::all, f); + AFIO_V2_NAMESPACE::io_service service; + auto h = AFIO_V2_NAMESPACE::async_file_handle::async_file(service, "testfile.txt", m, c, AFIO_V2_NAMESPACE::async_file_handle::caching::all, f); if(h) - h.get().close(); + h.value().close(); return h; } } diff --git a/test/tests/file_handle_create_close/kernel_file_handle.cpp.hpp b/test/tests/file_handle_create_close/kernel_file_handle.cpp.hpp index a45ff5b0..78c39169 100644 --- a/test/tests/file_handle_create_close/kernel_file_handle.cpp.hpp +++ b/test/tests/file_handle_create_close/kernel_file_handle.cpp.hpp @@ -26,12 +26,12 @@ Distributed under the Boost Software License, Version 1.0. namespace file_handle_create_close { - BOOST_AFIO_TEST_KERNEL_DECL boost::outcome::result<boost::afio::file_handle> test_kernel_file_handle(boost::afio::file_handle::mode m, boost::afio::file_handle::creation c, boost::afio::file_handle::flag f) + AFIO_TEST_KERNEL_DECL AFIO_V2_NAMESPACE::result<AFIO_V2_NAMESPACE::file_handle> test_kernel_file_handle(AFIO_V2_NAMESPACE::file_handle::mode m, AFIO_V2_NAMESPACE::file_handle::creation c, AFIO_V2_NAMESPACE::file_handle::flag f) { //! \todo TODO Use tempfile() once I've implemented it, that works around this being unsafe under mt permutation - auto h = boost::afio::file_handle::file("testfile.txt", m, c, boost::afio::file_handle::caching::all, f); + auto h = AFIO_V2_NAMESPACE::file_handle::file("testfile.txt", m, c, AFIO_V2_NAMESPACE::file_handle::caching::all, f); if(h) - h.get().close(); + h.value().close(); return h; } } diff --git a/test/tests/file_handle_create_close/runner.cpp b/test/tests/file_handle_create_close/runner.cpp index ccdbb383..b0e3a59b 100644 --- a/test/tests/file_handle_create_close/runner.cpp +++ b/test/tests/file_handle_create_close/runner.cpp @@ -22,15 +22,15 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#include "../kerneltest/include/boost/kerneltest.hpp" +#include "../kerneltest/include/kerneltest.hpp" #include "kernel_async_file_handle.cpp.hpp" #include "kernel_file_handle.cpp.hpp" template <class U> inline void file_handle_create_close_creation(U &&f) { - using namespace BOOST_KERNELTEST_V1_NAMESPACE; - using file_handle = BOOST_AFIO_V2_NAMESPACE::file_handle; - using BOOST_OUTCOME_V1_NAMESPACE::stl11::errc; + using namespace KERNELTEST_V1_NAMESPACE; + using file_handle = AFIO_V2_NAMESPACE::file_handle; + using OUTCOME_V2_NAMESPACE::std::errc; static const result<void> success = make_valued_result<void>(); static const result<void> no_such_file_or_directory = make_errored_result(errc::no_such_file_or_directory); static const result<void> file_exists = make_errored_result(errc::file_exists); @@ -96,5 +96,5 @@ template <class U> inline void file_handle_create_close_creation(U &&f) check_results_with_boost_test(permuter, results); } -BOOST_KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, file_handle, "Tests that afio::file_handle's creation parameter works as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_file_handle)) -BOOST_KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, async_file_handle, "Tests that afio::async_file_handle's creation parameter works as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_async_file_handle)) +KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, file_handle, "Tests that afio::file_handle's creation parameter works as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_file_handle)) +KERNELTEST_TEST_KERNEL(unit, afio, file_handle_create_close, async_file_handle, "Tests that afio::async_file_handle's creation parameter works as expected", file_handle_create_close_creation(file_handle_create_close::test_kernel_async_file_handle)) |