From 6c287673ed3163d70ced1ec067526758337fa67c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Jun 2026 20:09:59 +0200 Subject: boost::format -> std::format --- test/echo.cpp | 5 +++-- test/unit_tests/fixtures.hpp | 3 ++- test/unit_tests/resource.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/echo.cpp b/test/echo.cpp index 7354e7e..858ee3a 100644 --- a/test/echo.cpp +++ b/test/echo.cpp @@ -10,6 +10,7 @@ #include // clang-format on +#include #include #include @@ -23,12 +24,12 @@ int wmain(int argc, wchar_t* argv[]) { if (argc > 0) { for (int i = 0; i < argc; ++i) { - std::wcout << argv[i] << L'\n'; + std::wcout << std::format(L"{}\n", argv[i]); } } else { std::wstring line; while (std::getline(std::wcin, line)) { - std::wcout << line << L'\n'; + std::wcout << std::format(L"{}\n", line); } } return 0; diff --git a/test/unit_tests/fixtures.hpp b/test/unit_tests/fixtures.hpp index ce8e1f4..a3b62be 100644 --- a/test/unit_tests/fixtures.hpp +++ b/test/unit_tests/fixtures.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -25,7 +26,7 @@ public: try { winapi::File::remove(m_path); } catch (const std::exception& e) { - BOOST_TEST_MESSAGE("Couldn't remove file " << m_path.get() << ": " << e.what()); + BOOST_TEST_MESSAGE(std::format("Couldn't remove file {}: {}", m_path.get(), e.what())); } } diff --git a/test/unit_tests/resource.cpp b/test/unit_tests/resource.cpp index 2f63703..bdba55f 100644 --- a/test/unit_tests/resource.cpp +++ b/test/unit_tests/resource.cpp @@ -8,20 +8,20 @@ #include #include -#include #include #include using namespace winapi; +#include #include #include namespace std { ostream& operator<<(ostream& os, unsigned char c) { - return os << boost::format("%|1$02x|") % static_cast(c); + return os << std::format("{:02x}", static_cast(c)); } ostream& operator<<(ostream& os, const vector& cs) { -- cgit v1.3