aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/unit_tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/unit_tests/resource.cpp5
-rw-r--r--test/unit_tests/shared/command.hpp3
-rw-r--r--test/unit_tests/shared/console.hpp4
-rw-r--r--test/unit_tests/shared/test_data.hpp2
-rw-r--r--test/unit_tests/shared/worker.hpp33
-rw-r--r--test/unit_tests/shmem.cpp9
6 files changed, 13 insertions, 43 deletions
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 <winapi/process.hpp>
#include <winapi/utf8.hpp>
-#include <boost/config.hpp>
#include <boost/format.hpp>
#include <boost/test/unit_test.hpp>
@@ -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 <winapi/shmem.hpp>
-#include <boost/config.hpp>
#include <boost/interprocess/sync/interprocess_condition.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
@@ -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 <winapi/process.hpp>
-#include <boost/config.hpp>
-
#include <windows.h>
#include <exception>
@@ -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 <winapi/shmem.hpp>
-#include <boost/config.hpp>
#include <boost/test/unit_test.hpp>
#include <condition_variable>
@@ -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;