summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-13 20:09:59 +0200
committerEgor Tensin <egor@tensin.name>2026-06-13 20:19:01 +0200
commit6c287673ed3163d70ced1ec067526758337fa67c (patch)
tree2a542b3ce7ddfd73e3a2c9a02fb57fae4c31ffd4
parentupdate .git-blame-ignore-revs (diff)
downloadwinapi-common-6c287673ed3163d70ced1ec067526758337fa67c.tar.gz
winapi-common-6c287673ed3163d70ced1ec067526758337fa67c.zip
boost::format -> std::format
-rw-r--r--test/echo.cpp5
-rw-r--r--test/unit_tests/fixtures.hpp3
-rw-r--r--test/unit_tests/resource.cpp4
3 files changed, 7 insertions, 5 deletions
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 <fcntl.h>
// clang-format on
+#include <format>
#include <iostream>
#include <string>
@@ -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 <boost/test/unit_test.hpp>
#include <exception>
+#include <format>
#include <stdexcept>
#include <string>
@@ -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 <winapi/process.hpp>
#include <winapi/utf8.hpp>
-#include <boost/format.hpp>
#include <boost/test/unit_test.hpp>
#include <cstdint>
using namespace winapi;
+#include <format>
#include <ostream>
#include <vector>
namespace std {
ostream& operator<<(ostream& os, unsigned char c) {
- return os << boost::format("%|1$02x|") % static_cast<uint32_t>(c);
+ return os << std::format("{:02x}", static_cast<uint32_t>(c));
}
ostream& operator<<(ostream& os, const vector<unsigned char>& cs) {