From 43d94e28372cbe5fed7a3c38e79407c0f56088b5 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:30 +0000 Subject: [PATCH 01/17] chore(build): containers, toolchains and portability fixes --- .devcontainer/devcontainer.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..2632bf7 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "VoidLibrary (GCC 16, CMake 4, Ninja)", + "build": { + "dockerfile": "../Dockerfile", + "context": ".." + }, + "workspaceFolder": "/src", + "workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind", + "remoteUser": "root", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "twxs.cmake" + ], + "settings": { + "cmake.generator": "Ninja", + "cmake.configureSettings": { + "CMAKE_CXX_COMPILER": "g++-16", + "CMAKE_C_COMPILER": "gcc-16", + "CMAKE_BUILD_TYPE": "Debug" + }, + "C_Cpp.default.cppStandard": "c++26" + } + } + }, + "postCreateCommand": "cmake --version && g++-16 --version && ninja --version" +} -- 2.54.0 From 65595362e27c3c23a1271d7d4ae3d565d2c51024 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:32 +0000 Subject: [PATCH 02/17] chore(build): containers, toolchains and portability fixes --- .devcontainer/mingw/README.md | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .devcontainer/mingw/README.md diff --git a/.devcontainer/mingw/README.md b/.devcontainer/mingw/README.md new file mode 100644 index 0000000..0a1dd7a --- /dev/null +++ b/.devcontainer/mingw/README.md @@ -0,0 +1,64 @@ +# Windows builds: MSYS2 (native) and MinGW-w64 (cross) + +## MSYS2 (native Windows, recommended for a full build) + +Install the MINGW64 toolchain and the optional libraries used by the modules: + +```bash +pacman -S --needed base-devel \ + mingw-w64-x86_64-toolchain \ + mingw-w64-x86_64-cmake \ + mingw-w64-x86_64-ninja \ + mingw-w64-x86_64-boost \ + mingw-w64-x86_64-openssl \ + mingw-w64-x86_64-libsodium \ + mingw-w64-x86_64-libarchive \ + mingw-w64-x86_64-sqlite3 \ + mingw-w64-x86_64-lua +``` + +Then, from a **MINGW64** shell (not the MSYS shell): + +```bash +cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug +cmake --build build +ctest --test-dir build --output-on-failure +``` + +Notes: + +- C++26 reflection requires GCC 16 or newer (`-freflection`). The build + probes for it; on older GCC some reflection-only tests are skipped. +- `Void::IO` currently has a POSIX (epoll) backend only; select the modules + you need with `-DVOID_ENABLED_MODULES=...` if a module is not yet available + on Windows. +- The Windows branches of `Void::System` (paths, bounded reads, audio) are + compiled by this configuration. + +## MinGW-w64 cross build (Linux container) + +`Dockerfile.mingw` uses the LLVM-MinGW toolchain (Clang + libc++ + the +MinGW-w64 runtime) on top of Ubuntu, together with CMake 4 and Ninja. The +matching devcontainer is in `.devcontainer/mingw/`. + +```bash +docker build -f Dockerfile.mingw -t voidlibrary-mingw . +docker run --rm -v "$PWD:/src" -w /src voidlibrary-mingw bash -lc ' + cmake -B build-mingw -S . -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64.cmake \ + -DCMAKE_BUILD_TYPE=Debug \ + -DVOID_ENABLE_TESTING=OFF \ + -DVOID_ENABLED_MODULES="Core;Functional;Containers;Math;Text;Algorithms;Unicode;Time;LogState" + cmake --build build-mingw +' +``` + +Cross-compiling cannot use the host's Boost/OpenSSL/libsodium/libarchive/SQLite/ +Lua libraries. Modules that need them (or the POSIX-only IO backend) are +therefore excluded from a cross build; use MSYS2 on Windows for those. + +- The toolchain file accepts GCC- or Clang-based MinGW prefixes and picks + whichever compiler exists. +- `CMAKE_CXX_STANDARD` can be pinned for older toolchains + (`-DCMAKE_CXX_STANDARD=23`); the build probes capabilities against the + selected standard. -- 2.54.0 From f9bde1d19fd92f0b1cfac564c9bd51375d3119d6 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:34 +0000 Subject: [PATCH 03/17] chore(build): containers, toolchains and portability fixes --- .devcontainer/mingw/devcontainer.json | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .devcontainer/mingw/devcontainer.json diff --git a/.devcontainer/mingw/devcontainer.json b/.devcontainer/mingw/devcontainer.json new file mode 100644 index 0000000..c6468cd --- /dev/null +++ b/.devcontainer/mingw/devcontainer.json @@ -0,0 +1,28 @@ +{ + "name": "VoidLibrary (MinGW-w64 cross build)", + "build": { + "dockerfile": "../../Dockerfile.mingw", + "context": "../.." + }, + "workspaceFolder": "/src", + "workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind", + "remoteUser": "root", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "twxs.cmake" + ], + "settings": { + "cmake.generator": "Ninja", + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "cmake/toolchains/mingw-w64.cmake", + "CMAKE_BUILD_TYPE": "Debug" + }, + "C_Cpp.default.cppStandard": "c++26" + } + } + }, + "postCreateCommand": "cmake --version && x86_64-w64-mingw32-g++ --version && ninja --version" +} -- 2.54.0 From fe6e2124addd3eed024ef68321d189d872e69431 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:36 +0000 Subject: [PATCH 04/17] chore(build): containers, toolchains and portability fixes --- .dockerignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..96a41bb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +build* +.git +.gitea +.github +.dockerignore +Dockerfile -- 2.54.0 From 5d5a8bf34550aa60934af973c2e3e0b711ff0e0c Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:40 +0000 Subject: [PATCH 05/17] chore(build): containers, toolchains and portability fixes --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfa6330..3155101 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,20 @@ option(VOID_ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer (Clang/GCC)" OFF) option(VOID_ENABLE_TSAN "Enable ThreadSanitizer (Clang/GCC)" OFF) option(VOID_ENABLE_COVERAGE "Enable code coverage instrumentation" OFF) -set(CMAKE_CXX_STANDARD 26) +# C++26 is the default. Cross/toolchain-limited builds (e.g. MinGW-w64 +# with an older GCC) may pin a lower standard explicitly. +if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 26) +endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_MODULE_MAP_FORMAT "gcc") +if(NOT DEFINED CMAKE_CXX_MODULE_MAP_FORMAT) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_MODULE_MAP_FORMAT "clang") + else() + set(CMAKE_CXX_MODULE_MAP_FORMAT "gcc") + endif() +endif() set(CXX_SCAN_FOR_MODULES OFF) # , , etc. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16) -- 2.54.0 From 905e44635e0956e63de40cfc2c017664f2d908f3 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:42 +0000 Subject: [PATCH 06/17] chore(build): containers, toolchains and portability fixes --- Dockerfile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eaf8f61 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +# Development image for VoidLibrary. +# +# Toolchain: GCC 16 (C++26 reflection), CMake 4, Ninja. +# Optional dependencies used by the modules: Boost, OpenSSL, libsodium, +# libarchive, SQLite3 and Lua 5.4. +# +# The image does not copy or build the sources: mount the repository at /src +# (the devcontainer does this) and configure/build there. + +FROM ubuntu:24.04 + +ARG DEBIAN_FRONTEND=noninteractive +ARG GCC_VERSION=16 +ARG CMAKE_VERSION=4.2.3 + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + curl \ + git \ + gnupg \ + ninja-build \ + pkg-config \ + software-properties-common \ + libboost-all-dev \ + libssl-dev \ + libsodium-dev \ + libarchive-dev \ + libsqlite3-dev \ + liblua5.4-dev \ + zlib1g-dev \ + && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + gcc-${GCC_VERSION} \ + g++-${GCC_VERSION} \ + && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \ + && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 100 \ + && rm -rf /var/lib/apt/lists/* + +RUN curl -fsSL -o /tmp/cmake.tar.gz \ + "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" \ + && tar -xzf /tmp/cmake.tar.gz -C /opt \ + && ln -s "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cmake" /usr/local/bin/cmake \ + && ln -s "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/ctest" /usr/local/bin/ctest \ + && ln -s "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cpack" /usr/local/bin/cpack \ + && rm /tmp/cmake.tar.gz + +WORKDIR /src + +CMD ["bash"] -- 2.54.0 From 71fcad80d395e5ff59e72bc127736c3f7602e6d7 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:44 +0000 Subject: [PATCH 07/17] chore(build): containers, toolchains and portability fixes --- Dockerfile.mingw | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile.mingw diff --git a/Dockerfile.mingw b/Dockerfile.mingw new file mode 100644 index 0000000..df9acd3 --- /dev/null +++ b/Dockerfile.mingw @@ -0,0 +1,29 @@ +# MinGW-w64 cross-build environment for VoidLibrary (Windows x64 from Linux). +# +# Uses the LLVM-MinGW toolchain (Clang + libc++ + MinGW-w64 runtime), which is +# new enough for the C++26 features this project uses. Reflection is not +# available on Clang, so the reflection-only tests are skipped exactly as on +# any non-reflecting compiler. + +FROM mstorsjo/llvm-mingw:latest + +ARG CMAKE_VERSION=4.2.3 + +# The base image is Ubuntu 24.04 with CMake 3.28; Void requires CMake 4. +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates curl git \ + && rm -rf /var/lib/apt/lists/* + +RUN curl -fsSL -o /tmp/cmake.tar.gz \ + "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" \ + && tar -xzf /tmp/cmake.tar.gz -C /opt \ + && ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cmake" /usr/local/bin/cmake \ + && ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/ctest" /usr/local/bin/ctest \ + && ln -sf "/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin/cpack" /usr/local/bin/cpack \ + && rm /tmp/cmake.tar.gz + +ENV PATH="/opt/llvm-mingw/bin:${PATH}" + +WORKDIR /src + +CMD ["bash"] -- 2.54.0 From 7686be1b232a1d143c83d1efe6e94ea95be9e14d Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:47 +0000 Subject: [PATCH 08/17] chore(build): containers, toolchains and portability fixes --- cmake/Capabilities.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/Capabilities.cmake b/cmake/Capabilities.cmake index c56c254..aafd88a 100644 --- a/cmake/Capabilities.cmake +++ b/cmake/Capabilities.cmake @@ -33,7 +33,7 @@ function(void_probe_capabilities) endif() cmake_push_check_state(RESET) - set(CMAKE_REQUIRED_FLAGS "-std=c++26") + set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD}") check_cxx_source_compiles( "#include \nint main() { std::expected e{0}; return *e; }\n" VOID_HAS_STD_EXPECTED @@ -46,10 +46,12 @@ function(void_probe_capabilities) endif() cmake_push_check_state(RESET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16) - set(CMAKE_REQUIRED_FLAGS "-std=c++26 -freflection") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16 AND + CMAKE_CXX_STANDARD GREATER_EQUAL 26) + set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD} -freflection") else() - set(CMAKE_REQUIRED_FLAGS "-std=c++26") + set(CMAKE_REQUIRED_FLAGS "-std=c++${CMAKE_CXX_STANDARD}") endif() check_cxx_source_compiles( "#include \nconsteval bool probe() { constexpr auto r = ^^int; return std::meta::is_type(r); }\nstatic_assert(probe());\nint main() { return 0; }\n" -- 2.54.0 From 216a14e6fab826c12aee8bddcd7398c991e393b6 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:52 +0000 Subject: [PATCH 09/17] chore(build): containers, toolchains and portability fixes --- cmake/Module.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Module.cmake b/cmake/Module.cmake index a22652a..d556422 100644 --- a/cmake/Module.cmake +++ b/cmake/Module.cmake @@ -33,7 +33,7 @@ function(void_add_module MODULE_NAME) set(LIB_TYPE "INTERFACE") set(SCOPE "INTERFACE") add_library(${TGT} INTERFACE) - target_compile_features(${TGT} INTERFACE cxx_std_26) + target_compile_features(${TGT} INTERFACE cxx_std_${CMAKE_CXX_STANDARD}) else() set(SCOPE "PUBLIC") if (MODULE_NAME STREQUAL "Testing") @@ -45,7 +45,7 @@ function(void_add_module MODULE_NAME) add_library(${TGT}) endif() target_sources(${TGT} PRIVATE ${SRC}) - target_compile_features(${TGT} PUBLIC cxx_std_26) + target_compile_features(${TGT} PUBLIC cxx_std_${CMAKE_CXX_STANDARD}) endif() get_target_property(_module_target_type ${TGT} TYPE) if(_module_target_type STREQUAL "SHARED_LIBRARY" OR @@ -221,7 +221,7 @@ function(void_add_module MODULE_NAME) endif() set_target_properties(${TGT} PROPERTIES - CXX_STANDARD 26 + CXX_STANDARD ${CMAKE_CXX_STANDARD} CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF EXPORT_NAME ${MODULE_NAME} -- 2.54.0 From f8e183b7ab53c3437f293da4b28f596435b32db5 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:54 +0000 Subject: [PATCH 10/17] chore(build): containers, toolchains and portability fixes --- cmake/toolchains/mingw-w64.cmake | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 cmake/toolchains/mingw-w64.cmake diff --git a/cmake/toolchains/mingw-w64.cmake b/cmake/toolchains/mingw-w64.cmake new file mode 100644 index 0000000..3d7b2e5 --- /dev/null +++ b/cmake/toolchains/mingw-w64.cmake @@ -0,0 +1,33 @@ +# CMake toolchain for cross-compiling to Windows x64 with MinGW-w64. +# +# Works with the GCC-based mingw-w64 package and with the LLVM-MinGW +# toolchain (Dockerfile.mingw). Override the compiler paths for your install. +# +# Usage: +# cmake -B build-mingw -S . -G Ninja \ +# -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64.cmake \ +# -DCMAKE_BUILD_TYPE=Debug + +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR x86_64) + +if(NOT DEFINED VOID_MINGW_PREFIX) + set(VOID_MINGW_PREFIX x86_64-w64-mingw32) +endif() + +find_program(VOID_MINGW_CXX NAMES "${VOID_MINGW_PREFIX}-clang++" + "${VOID_MINGW_PREFIX}-g++" REQUIRED) +find_program(VOID_MINGW_C NAMES "${VOID_MINGW_PREFIX}-clang" + "${VOID_MINGW_PREFIX}-gcc" REQUIRED) +find_program(VOID_MINGW_RC NAMES "${VOID_MINGW_PREFIX}-windres") + +set(CMAKE_CXX_COMPILER "${VOID_MINGW_CXX}") +set(CMAKE_C_COMPILER "${VOID_MINGW_C}") +if(VOID_MINGW_RC) + set(CMAKE_RC_COMPILER "${VOID_MINGW_RC}") +endif() + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -- 2.54.0 From 774df0fd1ed8b66c984b0da3805a16f4bad4f2ec Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:09:58 +0000 Subject: [PATCH 11/17] chore(build): containers, toolchains and portability fixes --- include/Void/System/Audio.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/Void/System/Audio.hpp b/include/Void/System/Audio.hpp index ae50c80..a57bbef 100644 --- a/include/Void/System/Audio.hpp +++ b/include/Void/System/Audio.hpp @@ -263,6 +263,7 @@ class AudioDevice HWAVEOUT wave{}; WAVEHDR header{}; WAVEFORMATEX format{}; + std::vector playback; bool prepared{false}; #endif }; @@ -343,11 +344,14 @@ class AudioDevice "waveOutOpen failed"}}; } voice.header = WAVEHDR{}; + // waveOut only reads the samples, but WAVEHDR exposes a mutable + // buffer; keep an owned mutable copy instead of casting away + // constness of the shared buffer. + voice.playback = voice.buffer->samples; voice.header.lpData = - reinterpret_cast( - const_cast(voice.buffer->samples.data())); + reinterpret_cast(voice.playback.data()); voice.header.dwBufferLength = static_cast( - voice.buffer->samples.size() * sizeof(PcmSample)); + voice.playback.size() * sizeof(PcmSample)); if (::waveOutPrepareHeader(voice.wave, &voice.header, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) { -- 2.54.0 From 5a74233a4d9e663267e05898135570dc806e1095 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:02 +0000 Subject: [PATCH 12/17] chore(build): containers, toolchains and portability fixes --- include/Void/System/Path.hpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/include/Void/System/Path.hpp b/include/Void/System/Path.hpp index 9fcfedc..dc68e10 100644 --- a/include/Void/System/Path.hpp +++ b/include/Void/System/Path.hpp @@ -209,22 +209,18 @@ private: [[nodiscard]] inline std::string win32_message(DWORD error) { - char* buffer = nullptr; + std::array buffer{}; const DWORD length = ::FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - reinterpret_cast(&buffer), - 0, + buffer.data(), + static_cast(buffer.size()), nullptr); - std::string message = (length != 0 && buffer != nullptr) - ? std::string{buffer, length} + std::string message = length != 0 + ? std::string{buffer.data(), length} : std::string{"unknown error"}; - if (buffer != nullptr) { - ::LocalFree(buffer); - } while (!message.empty() && (message.back() == '\n' || message.back() == '\r' || message.back() == ' ' || message.back() == '.')) { -- 2.54.0 From 496d9fc5827124536089c77d7ed29b7728c94380 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:07 +0000 Subject: [PATCH 13/17] chore(build): containers, toolchains and portability fixes --- include/Void/Testing/Suite.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/include/Void/Testing/Suite.hpp b/include/Void/Testing/Suite.hpp index 0cc32bd..5583db1 100644 --- a/include/Void/Testing/Suite.hpp +++ b/include/Void/Testing/Suite.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include @@ -11,6 +10,7 @@ #if __has_include() #include +#include #define VOID_TESTING_HAS_REFLECTION 1 #endif @@ -95,6 +95,13 @@ namespace Void::Testing } } + /// Non-capturing thunk: a template argument is a constant + /// expression, unlike a reflected member captured by a lambda. + template static void run_method_thunk() + { + run_method(); + } + static std::string suite_label() { if constexpr (constexpr auto n = @@ -138,12 +145,17 @@ namespace Void::Testing skip_reason = std::string{s->reason.view()}; } + constexpr auto name = meta::identifier_of(m); + constexpr const char* file = loc.file_name(); + constexpr int line = + static_cast(loc.line()); + constexpr auto run = &run_method_thunk; reg.add(TestCase{ - .run = [] { run_method(); }, - .name = std::string{meta::identifier_of(m)}, + .run = run, + .name = std::string{name}, .suite = suite, - .file = loc.file_name(), - .line = static_cast(loc.line()), + .file = file, + .line = line, .disabled = disabled, .skip_reason = std::move(skip_reason), .tags = std::move(tags), -- 2.54.0 From 12ba8d8e2cbe82dd81cf6016e1e8718c3ad79613 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:10 +0000 Subject: [PATCH 14/17] chore(build): containers, toolchains and portability fixes --- src/Testing/ConsoleReporter.cpp | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Testing/ConsoleReporter.cpp b/src/Testing/ConsoleReporter.cpp index 718071f..c0ad156 100644 --- a/src/Testing/ConsoleReporter.cpp +++ b/src/Testing/ConsoleReporter.cpp @@ -8,14 +8,14 @@ namespace Void::Testing { using namespace Void::Testing::Detail::Color; void ConsoleReporter::on_run_start(const RunConfig&, int total_tests) { - os_ << "\n" << apply(bold_blue, "╭──────────────────────────────────────────────╮") << "\n" - << apply(bold_blue, "│") << apply(bold_white, " Void Testing") << apply(dim, " v1.0") << std::string(31, ' ') << apply(bold_blue, "│") << "\n" - << std::format("{}│{} Discovered {} test{}{}│\n", apply(bold_blue, "╰"), apply(dim, ""), apply(bold_white, std::to_string(total_tests)), total_tests != 1 ? "s" : "", std::string(total_tests < 10 ? 33 : 28, ' ')) - << apply(bold_blue, "╰──────────────────────────────────────────────╯") << "\n\n"; + os_ << "\n" << Void::Testing::Detail::Color::apply(bold_blue, "╭──────────────────────────────────────────────╮") << "\n" + << Void::Testing::Detail::Color::apply(bold_blue, "│") << Void::Testing::Detail::Color::apply(bold_white, " Void Testing") << Void::Testing::Detail::Color::apply(dim, " v1.0") << std::string(31, ' ') << Void::Testing::Detail::Color::apply(bold_blue, "│") << "\n" + << std::format("{}│{} Discovered {} test{}{}│\n", Void::Testing::Detail::Color::apply(bold_blue, "╰"), Void::Testing::Detail::Color::apply(dim, ""), Void::Testing::Detail::Color::apply(bold_white, std::to_string(total_tests)), total_tests != 1 ? "s" : "", std::string(total_tests < 10 ? 33 : 28, ' ')) + << Void::Testing::Detail::Color::apply(bold_blue, "╰──────────────────────────────────────────────╯") << "\n\n"; } void ConsoleReporter::on_suite_start(const std::string& suite_name, int test_count) { - os_ << std::format(" {} {} [{} test{}]\n", apply(bold_blue, "◆"), apply(bold_white, suite_name), apply(dim, std::to_string(test_count)), test_count != 1 ? "s" : ""); + os_ << std::format(" {} {} [{} test{}]\n", Void::Testing::Detail::Color::apply(bold_blue, "◆"), Void::Testing::Detail::Color::apply(bold_white, suite_name), Void::Testing::Detail::Color::apply(dim, std::to_string(test_count)), test_count != 1 ? "s" : ""); } void ConsoleReporter::on_test_start(const TestCase&) {} @@ -25,46 +25,46 @@ void ConsoleReporter::on_test_end(const TestResult& result) { double ms = std::chrono::duration(result.duration).count(); std::string time_str = ms < 1.0 ? std::format("{:.3f}ms", ms) : std::format("{:.1f}ms", ms); std::string tags_str; - if (!result.tags.empty()) { for(const auto& t : result.tags) tags_str += "[" + t + "]"; tags_str = " " + apply(dim, tags_str); } + if (!result.tags.empty()) { for(const auto& t : result.tags) tags_str += "[" + t + "]"; tags_str = " " + Void::Testing::Detail::Color::apply(dim, tags_str); } switch (result.state) { - case TestState::Passed: os_ << std::format(" {} {:<40s}{}{}\n", apply(bold_green, "✔"), apply(green, result.name), tags_str, apply(dim, time_str)); break; + case TestState::Passed: os_ << std::format(" {} {:<40s}{}{}\n", Void::Testing::Detail::Color::apply(bold_green, "✔"), Void::Testing::Detail::Color::apply(green, result.name), tags_str, Void::Testing::Detail::Color::apply(dim, time_str)); break; case TestState::Failed: - os_ << std::format(" {} {:<40s}{}{}\n", apply(bold_red, "✘"), apply(red, result.name), tags_str, apply(dim, time_str)); + os_ << std::format(" {} {:<40s}{}{}\n", Void::Testing::Detail::Color::apply(bold_red, "✘"), Void::Testing::Detail::Color::apply(red, result.name), tags_str, Void::Testing::Detail::Color::apply(dim, time_str)); for (const auto& ar : result.assertions) if (!ar.passed) print_assertion_failure(ar); if (!result.crash_info.empty()) print_crash_info(result); break; - case TestState::Skipped: os_ << std::format(" {} {:<40s}{}\n", apply(bold_yellow, "⊘"), apply(yellow, result.name), apply(dim, std::format("[SKIPPED: {}]", result.skip_reason.empty() ? "no reason" : result.skip_reason))); break; - case TestState::Crashed: os_ << std::format(" {} {:<40s}{}\n", apply(bold_red, "⚡"), apply(red, result.name), apply(dim, time_str)); print_crash_info(result); break; + case TestState::Skipped: os_ << std::format(" {} {:<40s}{}\n", Void::Testing::Detail::Color::apply(bold_yellow, "⊘"), Void::Testing::Detail::Color::apply(yellow, result.name), Void::Testing::Detail::Color::apply(dim, std::format("[SKIPPED: {}]", result.skip_reason.empty() ? "no reason" : result.skip_reason))); break; + case TestState::Crashed: os_ << std::format(" {} {:<40s}{}\n", Void::Testing::Detail::Color::apply(bold_red, "⚡"), Void::Testing::Detail::Color::apply(red, result.name), Void::Testing::Detail::Color::apply(dim, time_str)); print_crash_info(result); break; } } void ConsoleReporter::print_assertion_failure(const AssertionResult& ar) { - os_ << apply(red, " ╭─── Assertion Failed") << apply(dim, " ──────────────────────╮") << "\n"; + os_ << Void::Testing::Detail::Color::apply(red, " ╭─── Assertion Failed") << Void::Testing::Detail::Color::apply(dim, " ──────────────────────╮") << "\n"; std::filesystem::path p{ar.location.file_name()}; - os_ << std::format(" │ {}:{}\n", apply(bold_white, p.filename().string()), ar.location.line()); - if (!ar.expression.empty()) os_ << std::format(" │ {}\n", apply(cyan, ar.expression)); - if (!ar.expected_repr.empty()) os_ << std::format(" │ {} {}\n", apply(bold_white, "expected:"), apply(green, ar.expected_repr)); - if (!ar.actual_repr.empty()) os_ << std::format(" │ {} {}\n", apply(bold_white, "actual: "), apply(red, ar.actual_repr)); + os_ << std::format(" │ {}:{}\n", Void::Testing::Detail::Color::apply(bold_white, p.filename().string()), ar.location.line()); + if (!ar.expression.empty()) os_ << std::format(" │ {}\n", Void::Testing::Detail::Color::apply(cyan, ar.expression)); + if (!ar.expected_repr.empty()) os_ << std::format(" │ {} {}\n", Void::Testing::Detail::Color::apply(bold_white, "expected:"), Void::Testing::Detail::Color::apply(green, ar.expected_repr)); + if (!ar.actual_repr.empty()) os_ << std::format(" │ {} {}\n", Void::Testing::Detail::Color::apply(bold_white, "actual: "), Void::Testing::Detail::Color::apply(red, ar.actual_repr)); if (!ar.message.empty()) os_ << std::format(" │ {}\n", ar.message); - os_ << apply(red, " ╰────────────────────────────────────────────╯") << "\n"; + os_ << Void::Testing::Detail::Color::apply(red, " ╰────────────────────────────────────────────╯") << "\n"; } void ConsoleReporter::print_crash_info(const TestResult& result) { - os_ << apply(bold_red, " ╭─── Crash") << apply(dim, " ───────────────────────────╮") << "\n"; - if (!result.crash_info.empty()) os_ << std::format(" │ {}\n", apply(red, result.crash_info)); - os_ << apply(bold_red, " ╰────────────────────────────────────────────╯") << "\n"; - if (!result.stacktrace.empty()) os_ << apply(dim, " Stacktrace:\n") << result.stacktrace << "\n"; + os_ << Void::Testing::Detail::Color::apply(bold_red, " ╭─── Crash") << Void::Testing::Detail::Color::apply(dim, " ───────────────────────────╮") << "\n"; + if (!result.crash_info.empty()) os_ << std::format(" │ {}\n", Void::Testing::Detail::Color::apply(red, result.crash_info)); + os_ << Void::Testing::Detail::Color::apply(bold_red, " ╰────────────────────────────────────────────╯") << "\n"; + if (!result.stacktrace.empty()) os_ << Void::Testing::Detail::Color::apply(dim, " Stacktrace:\n") << result.stacktrace << "\n"; } void ConsoleReporter::on_run_end(const RunResult& result) { - os_ << "\n" << apply(dim, "╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍") << "\n" - << std::format(" {} tests: ", apply(bold_white, std::to_string(result.total))); - if (result.passed > 0) os_ << std::format("{} {} ", apply(bold_green, std::to_string(result.passed)), apply(green, "✔")); - if (result.failed + result.crashed > 0) os_ << std::format("{} {} ", apply(bold_red, std::to_string(result.failed + result.crashed)), apply(red, "✘")); - if (result.skipped > 0) os_ << std::format("{} {} ", apply(bold_yellow, std::to_string(result.skipped)), apply(yellow, "⊘")); + os_ << "\n" << Void::Testing::Detail::Color::apply(dim, "╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍") << "\n" + << std::format(" {} tests: ", Void::Testing::Detail::Color::apply(bold_white, std::to_string(result.total))); + if (result.passed > 0) os_ << std::format("{} {} ", Void::Testing::Detail::Color::apply(bold_green, std::to_string(result.passed)), Void::Testing::Detail::Color::apply(green, "✔")); + if (result.failed + result.crashed > 0) os_ << std::format("{} {} ", Void::Testing::Detail::Color::apply(bold_red, std::to_string(result.failed + result.crashed)), Void::Testing::Detail::Color::apply(red, "✘")); + if (result.skipped > 0) os_ << std::format("{} {} ", Void::Testing::Detail::Color::apply(bold_yellow, std::to_string(result.skipped)), Void::Testing::Detail::Color::apply(yellow, "⊘")); double total_ms = std::chrono::duration(result.total_duration).count(); - os_ << std::format(" {} {}\n", apply(dim, "in"), apply(bold_cyan, total_ms < 1000 ? std::format("{:.1f}ms", total_ms) : std::format("{:.2f}s", total_ms / 1000.0))) - << apply(dim, "╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍") << "\n\n"; + os_ << std::format(" {} {}\n", Void::Testing::Detail::Color::apply(dim, "in"), Void::Testing::Detail::Color::apply(bold_cyan, total_ms < 1000 ? std::format("{:.1f}ms", total_ms) : std::format("{:.2f}s", total_ms / 1000.0))) + << Void::Testing::Detail::Color::apply(dim, "╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍") << "\n\n"; } } // namespace Void::Testing -- 2.54.0 From c8f0113d48b7ad1ba08d3eb1033dfaf3cab42226 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:14 +0000 Subject: [PATCH 15/17] chore(build): containers, toolchains and portability fixes --- src/Testing/Runner.cpp | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Testing/Runner.cpp b/src/Testing/Runner.cpp index 53bc159..69ea215 100644 --- a/src/Testing/Runner.cpp +++ b/src/Testing/Runner.cpp @@ -447,7 +447,7 @@ namespace Void::Testing std::cout << "\n" - << apply(bold_blue, + << Void::Testing::Detail::Color::apply(bold_blue, "\xe2\x95\xad\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" "\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" "\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" @@ -461,12 +461,12 @@ namespace Void::Testing "\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" "\xe2\x94\x80\xe2\x94\x80\xe2\x95\xae") << "\n" - << apply(bold_blue, "\xe2\x94\x82") - << apply(bold_white, " Void Testing") - << apply(dim, " \xe2\x80\x94 Command Line Interface") - << std::string(28, ' ') << apply(bold_blue, "\xe2\x94\x82") + << Void::Testing::Detail::Color::apply(bold_blue, "\xe2\x94\x82") + << Void::Testing::Detail::Color::apply(bold_white, " Void Testing") + << Void::Testing::Detail::Color::apply(dim, " \xe2\x80\x94 Command Line Interface") + << std::string(28, ' ') << Void::Testing::Detail::Color::apply(bold_blue, "\xe2\x94\x82") << "\n" - << apply(bold_blue, + << Void::Testing::Detail::Color::apply(bold_blue, "\xe2\x95\xb0\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" "\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" "\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80" @@ -481,76 +481,76 @@ namespace Void::Testing "\xe2\x94\x80\xe2\x94\x80\xe2\x95\xaf") << "\n" << "\n" - << " " << apply(bold_white, "USAGE:") << "\n" - << " " << apply(cyan, "") << " " - << apply(dim, "[options]") << "\n" + << " " << Void::Testing::Detail::Color::apply(bold_white, "USAGE:") << "\n" + << " " << Void::Testing::Detail::Color::apply(cyan, "") << " " + << Void::Testing::Detail::Color::apply(dim, "[options]") << "\n" << "\n" - << " " << apply(bold_white, "OPTIONS:") << "\n"; + << " " << Void::Testing::Detail::Color::apply(bold_white, "OPTIONS:") << "\n"; constexpr std::size_t OPT_WIDTH = 23; auto opt = [&](std::string_view name) { #ifdef VOID_HAS_TEXT - return apply(green, Void::Str::pad_right(name, OPT_WIDTH)); + return Void::Testing::Detail::Color::apply(green, Void::Str::pad_right(name, OPT_WIDTH)); #else std::string s{name}; if (s.size() < OPT_WIDTH) { s.append(OPT_WIDTH - s.size(), ' '); } - return apply(green, s); + return Void::Testing::Detail::Color::apply(green, s); #endif }; std::cout << " " << opt("--filter ") - << apply(dim, "Run tests matching the regex pattern") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Run tests matching the regex pattern") << "\n" << " " << opt("--suite ") - << apply(dim, "Run only tests in the specified suite") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Run only tests in the specified suite") << "\n" << " " << opt("--tag ") - << apply(dim, "Run only tests with the specified tag") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Run only tests with the specified tag") << "\n" << " " << opt("--list") - << apply(dim, "List discovered tests without running them") + << Void::Testing::Detail::Color::apply(dim, "List discovered tests without running them") << "\n" << " " << opt("--shuffle") - << apply(dim, "Randomize the order of test execution") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Randomize the order of test execution") << "\n" << " " << opt("--seed ") - << apply(dim, "Set the random seed (implies --shuffle)") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Set the random seed (implies --shuffle)") << "\n" << " " << opt("--repeat ") - << apply(dim, "Repeat the test run n times") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Repeat the test run n times") << "\n" << " " << opt("--reporter ") - << apply(dim, "Choose the output reporter: console, junit") + << Void::Testing::Detail::Color::apply(dim, "Choose the output reporter: console, junit") << "\n" << " " << opt("--output ") - << apply(dim, "Write reporter output to a file") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Write reporter output to a file") << "\n" #ifdef VOID_HAS_LOG << " " << opt("--log-file ") - << apply(dim, + << Void::Testing::Detail::Color::apply(dim, "Mirror test events to via Void::Logging") << "\n" #endif #ifdef VOID_HAS_ASYNC << " " << opt("--parallel ") - << apply(dim, + << Void::Testing::Detail::Color::apply(dim, "Run tests across n threads (no crash detection)") << "\n" #endif << " " << opt("--verbose") - << apply(dim, "Enable verbose output") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Enable verbose output") << "\n" << " " << opt("--no-color") - << apply(dim, "Disable colored console output") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Disable colored console output") << "\n" << " " << opt("--allow-empty") - << apply(dim, "Do not fail when selection matches zero tests") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Do not fail when selection matches zero tests") << "\n" << " " << opt("--help") - << apply(dim, "Show this help message") << "\n" + << Void::Testing::Detail::Color::apply(dim, "Show this help message") << "\n" << "\n" - << " " << apply(bold_white, "EXAMPLES:") << "\n" - << " " << apply(cyan, "./run_tests") << " " - << apply(yellow, "--filter") << " \"math_tests.*\"" << "\n" - << " " << apply(cyan, "./run_tests") << " " - << apply(yellow, "--tag") << " integration " - << apply(yellow, "--shuffle") << "\n" - << " " << apply(cyan, "./run_tests") << " " - << apply(yellow, "--reporter") << " junit " - << apply(yellow, "--output") << " results.xml" << "\n" + << " " << Void::Testing::Detail::Color::apply(bold_white, "EXAMPLES:") << "\n" + << " " << Void::Testing::Detail::Color::apply(cyan, "./run_tests") << " " + << Void::Testing::Detail::Color::apply(yellow, "--filter") << " \"math_tests.*\"" << "\n" + << " " << Void::Testing::Detail::Color::apply(cyan, "./run_tests") << " " + << Void::Testing::Detail::Color::apply(yellow, "--tag") << " integration " + << Void::Testing::Detail::Color::apply(yellow, "--shuffle") << "\n" + << " " << Void::Testing::Detail::Color::apply(cyan, "./run_tests") << " " + << Void::Testing::Detail::Color::apply(yellow, "--reporter") << " junit " + << Void::Testing::Detail::Color::apply(yellow, "--output") << " results.xml" << "\n" << "\n"; return {}; -- 2.54.0 From aebc38791acb6ecee44c275f6e464f0412fa8550 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:18 +0000 Subject: [PATCH 16/17] chore(build): containers, toolchains and portability fixes --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2759bda..62e6fd1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -167,7 +167,7 @@ if(TARGET VoidTests AND (TARGET Void::System OR TARGET Void::IPC)) add_executable(VoidProcessHelper "${CMAKE_CURRENT_SOURCE_DIR}/helpers/ProcessHelper.cpp") set_target_properties(VoidProcessHelper PROPERTIES - CXX_STANDARD 26 + CXX_STANDARD ${CMAKE_CXX_STANDARD} CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF VOID_TESTING_NO_AUTO_SCAN TRUE) @@ -181,7 +181,7 @@ if(TARGET VoidTests AND TARGET Void::Archive) "${CMAKE_CURRENT_SOURCE_DIR}/helpers/ArchiveWorker.cpp") target_link_libraries(VoidArchiveWorker PRIVATE Void::Archive) set_target_properties(VoidArchiveWorker PROPERTIES - CXX_STANDARD 26 + CXX_STANDARD ${CMAKE_CXX_STANDARD} CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF VOID_TESTING_NO_AUTO_SCAN TRUE) -- 2.54.0 From d5cfd9cd7ac54a0032acb250a74f7050a1aa3321 Mon Sep 17 00:00:00 2001 From: Aleksey Selihov <1+faumaray@noreply@void.com> Date: Thu, 3 Dec 2026 08:10:22 +0000 Subject: [PATCH 17/17] chore(build): containers, toolchains and portability fixes --- tests/standalone/Messaging/RequestLedger.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/standalone/Messaging/RequestLedger.cpp b/tests/standalone/Messaging/RequestLedger.cpp index 4c14c6e..72ac94f 100644 --- a/tests/standalone/Messaging/RequestLedger.cpp +++ b/tests/standalone/Messaging/RequestLedger.cpp @@ -33,7 +33,7 @@ Void::Testing::Test request_ledger_replays_exact_repeat() auto repeat = ledger.check(k, "op"); Void::Testing::expect(repeat.status == Status::replay); Void::Testing::require(repeat.result.has_value()); - Void::Testing::expect_eq(*repeat.result, 7); + Void::Testing::expect_eq(repeat.result->value(), 7); } Void::Testing::Test request_ledger_replays_rejected_outcome() @@ -67,7 +67,7 @@ Void::Testing::Test request_ledger_detects_payload_conflict() // The conflicting retry changed nothing. auto repeat = ledger.check(k, "payload-a"); Void::Testing::expect(repeat.status == Status::replay); - Void::Testing::expect_eq(*repeat.result, 10); + Void::Testing::expect_eq(repeat.result->value(), 10); } Void::Testing::Test request_ledger_delayed_retry_after_newer_operations() @@ -82,7 +82,7 @@ Void::Testing::Test request_ledger_delayed_retry_after_newer_operations() auto delayed = ledger.check(first, "one"); Void::Testing::expect(delayed.status == Status::replay); - Void::Testing::expect_eq(*delayed.result, 100); + Void::Testing::expect_eq(delayed.result->value(), 100); } Void::Testing::Test request_ledger_epoch_rollover() @@ -136,7 +136,7 @@ Void::Testing::Test request_ledger_in_progress_and_result_is_immutable() Void::Testing::expect(!ledger.record(k, 6)); auto repeat = ledger.check(k, "op"); Void::Testing::expect(repeat.status == Status::replay); - Void::Testing::expect_eq(*repeat.result, 5); + Void::Testing::expect_eq(repeat.result->value(), 5); const auto snap = ledger.snapshot(); Void::Testing::expect_eq(snap.size, std::size_t{1}); -- 2.54.0