From 1e5e37a9d1af571e962671db95b23c7cc7ddce6d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 16 May 2021 18:38:30 +0300 Subject: remove VS 2013 cruft --- test/unit_tests/resource.cpp | 5 ++--- test/unit_tests/shared/command.hpp | 3 +-- test/unit_tests/shared/console.hpp | 4 ++-- test/unit_tests/shared/test_data.hpp | 2 +- test/unit_tests/shared/worker.hpp | 33 +++------------------------------ test/unit_tests/shmem.cpp | 9 ++++----- 6 files changed, 13 insertions(+), 43 deletions(-) (limited to 'test/unit_tests') diff --git a/test/unit_tests/resource.cpp b/test/unit_tests/resource.cpp index 66556d5..2f63703 100644 --- a/test/unit_tests/resource.cpp +++ b/test/unit_tests/resource.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -39,13 +38,13 @@ BOOST_TEST_SPECIALIZED_COLLECTION_COMPARE(Buffer); BOOST_AUTO_TEST_SUITE(resource_tests) BOOST_AUTO_TEST_CASE(get_string) { - BOOST_STATIC_CONSTEXPR auto expected = "This is a test resource string!"; + static constexpr auto expected = "This is a test resource string!"; const auto actual = Process::get_resource_string(IDS_TEST_STRING); BOOST_TEST(actual == expected); } BOOST_AUTO_TEST_CASE(get_string_wide) { - BOOST_STATIC_CONSTEXPR auto expected = "This is another test string, wide this time."; + static constexpr auto expected = "This is another test string, wide this time."; const auto actual = Process::get_resource_string(IDS_TEST_STRING_WIDE); BOOST_TEST(actual == expected); } diff --git a/test/unit_tests/shared/command.hpp b/test/unit_tests/shared/command.hpp index 4a91370..4ba9385 100644 --- a/test/unit_tests/shared/command.hpp +++ b/test/unit_tests/shared/command.hpp @@ -9,7 +9,6 @@ #include -#include #include #include #include @@ -29,7 +28,7 @@ struct StdHandles { HANDLE err; }; -BOOST_STATIC_CONSTEXPR auto COMMAND_SHMEM_NAME = "shmem-test-cmd"; +static constexpr auto COMMAND_SHMEM_NAME = "shmem-test-cmd"; class Command { public: diff --git a/test/unit_tests/shared/console.hpp b/test/unit_tests/shared/console.hpp index 48d1faa..cdc12e4 100644 --- a/test/unit_tests/shared/console.hpp +++ b/test/unit_tests/shared/console.hpp @@ -28,9 +28,9 @@ class Buffer { public: typedef CONSOLE_SCREEN_BUFFER_INFO Info; - Buffer() : m_handle(winapi::Handle::std_out()), m_info(get_info(m_handle)) {} + Buffer() : m_handle{winapi::Handle::std_out()}, m_info{get_info(m_handle)} {} - Buffer(winapi::Handle&& handle) : m_handle(std::move(handle)), m_info(get_info(m_handle)) {} + Buffer(winapi::Handle&& handle) : m_handle{std::move(handle)}, m_info{get_info(m_handle)} {} int16_t get_columns() const { return m_info.dwSize.X; } diff --git a/test/unit_tests/shared/test_data.hpp b/test/unit_tests/shared/test_data.hpp index 0094f0b..1c8316a 100644 --- a/test/unit_tests/shared/test_data.hpp +++ b/test/unit_tests/shared/test_data.hpp @@ -10,7 +10,7 @@ namespace worker { namespace test_data { -BOOST_STATIC_CONSTEXPR auto str = "Test output."; +static constexpr auto str = "Test output."; inline std::string out() { return "stdout: " + std::string{str}; diff --git a/test/unit_tests/shared/worker.hpp b/test/unit_tests/shared/worker.hpp index a1067ac..9ba7020 100644 --- a/test/unit_tests/shared/worker.hpp +++ b/test/unit_tests/shared/worker.hpp @@ -9,8 +9,6 @@ #include -#include - #include #include @@ -22,23 +20,11 @@ namespace worker { class Worker { public: - Worker(winapi::Process&& process) : m_cmd(Command::create()), m_process(std::move(process)) {} - - Worker(Worker&& other) BOOST_NOEXCEPT_OR_NOTHROW : m_cmd(std::move(other.m_cmd)), - m_process(std::move(other.m_process)) {} - - Worker& operator=(Worker other) BOOST_NOEXCEPT_OR_NOTHROW { - swap(other); - return *this; - } - - void swap(Worker& other) BOOST_NOEXCEPT_OR_NOTHROW { - using std::swap; - swap(m_cmd, other.m_cmd); - swap(m_process, other.m_process); - } + Worker(winapi::Process&& process) : m_cmd{Command::create()}, m_process{std::move(process)} {} + Worker(Worker&& other) noexcept = default; Worker(const Worker&) = delete; + Worker& operator=(const Worker& other) noexcept = default; ~Worker() { try { @@ -101,17 +87,4 @@ private: winapi::Process m_process; }; -inline void swap(Worker& a, Worker& b) BOOST_NOEXCEPT_OR_NOTHROW { - a.swap(b); -} - } // namespace worker - -namespace std { - -template <> -inline void swap(worker::Worker& a, worker::Worker& b) BOOST_NOEXCEPT_OR_NOTHROW { - a.swap(b); -} - -} // namespace std diff --git a/test/unit_tests/shmem.cpp b/test/unit_tests/shmem.cpp index 894a0f9..d56242c 100644 --- a/test/unit_tests/shmem.cpp +++ b/test/unit_tests/shmem.cpp @@ -5,7 +5,6 @@ #include -#include #include #include @@ -17,11 +16,11 @@ using namespace winapi; namespace { -BOOST_CONSTEXPR_OR_CONST auto shmem_name = "test-data-struct"; +static constexpr auto shmem_name = "test-data-struct"; -BOOST_CONSTEXPR_OR_CONST int32_t main_data = -1; -BOOST_CONSTEXPR_OR_CONST int32_t setter1_data = 69; -BOOST_CONSTEXPR_OR_CONST int32_t setter2_data = 420; +static constexpr int32_t main_data = -1; +static constexpr int32_t setter1_data = 69; +static constexpr int32_t setter2_data = 420; struct DataStruct { std::mutex mtx; -- cgit v1.2.3