aboutsummaryrefslogtreecommitdiff
path: root/zenserver-test/zenserver-test.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-11-01 10:32:15 +0100
committerMartin Ridgers <[email protected]>2021-11-01 10:32:15 +0100
commit89bfb07a3f794b6a4d53cb442ea6f8fd021bbd3a (patch)
tree825bd1b0ec25feac76ff7e02c9d7fa559e656625 /zenserver-test/zenserver-test.cpp
parentFixed up some assumptions that satd::fs::path uses wchar_t (diff)
parentMinor cleanup (diff)
downloadzen-89bfb07a3f794b6a4d53cb442ea6f8fd021bbd3a.tar.xz
zen-89bfb07a3f794b6a4d53cb442ea6f8fd021bbd3a.zip
Merged main
Diffstat (limited to 'zenserver-test/zenserver-test.cpp')
-rw-r--r--zenserver-test/zenserver-test.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp
index 140effcc1..0fedd4b8b 100644
--- a/zenserver-test/zenserver-test.cpp
+++ b/zenserver-test/zenserver-test.cpp
@@ -66,6 +66,7 @@ ZEN_THIRD_PARTY_INCLUDES_END
#endif
using namespace fmt::literals;
+using namespace std::literals;
/*
@@ -126,10 +127,10 @@ public:
m_Headers.reserve(16);
zen::ExtendableStringBuilder<256> RequestBody;
- RequestBody << "GET " << Path << " HTTP/1.1\r\n";
- RequestBody << "Host: " << Server << "\r\n";
- RequestBody << "Accept: */*\r\n";
- RequestBody << "Connection: " << (m_KeepAlive ? "keep-alive" : "close") << "\r\n\r\n"; // TODO: support keep-alive
+ RequestBody << "GET "sv << Path << " HTTP/1.1\r\n"sv;
+ RequestBody << "Host: "sv << Server << "\r\n"sv;
+ RequestBody << "Accept: */*\r\n"sv;
+ RequestBody << "Connection: "sv << (m_KeepAlive ? "keep-alive"sv : "close"sv) << "\r\n\r\n"sv; // TODO: support keep-alive
m_RequestBody = RequestBody;
@@ -460,12 +461,12 @@ using namespace spdlog;
using namespace spdlog::details;
using namespace std::literals;
-class full_formatter final : public spdlog::formatter
+class full_test_formatter final : public spdlog::formatter
{
public:
- full_formatter(std::string_view LogId, std::chrono::time_point<std::chrono::system_clock> Epoch) : m_Epoch(Epoch), m_LogId(LogId) {}
+ full_test_formatter(std::string_view LogId, std::chrono::time_point<std::chrono::system_clock> Epoch) : m_Epoch(Epoch), m_LogId(LogId) {}
- virtual std::unique_ptr<formatter> clone() const override { return std::make_unique<full_formatter>(m_LogId, m_Epoch); }
+ virtual std::unique_ptr<formatter> clone() const override { return std::make_unique<full_test_formatter>(m_LogId, m_Epoch); }
static constexpr bool UseDate = false;
@@ -680,7 +681,7 @@ main(int argc, char** argv)
zen::logging::InitializeLogging();
spdlog::set_level(spdlog::level::debug);
- spdlog::set_formatter(std::make_unique<::logging::full_formatter>("test", std::chrono::system_clock::now()));
+ spdlog::set_formatter(std::make_unique<::logging::full_test_formatter>("test", std::chrono::system_clock::now()));
std::filesystem::path ProgramBaseDir = std::filesystem::path(argv[0]).parent_path();
std::filesystem::path TestBaseDir = ProgramBaseDir.parent_path().parent_path() / ".test";