diff options
| author | Stefan Boberg <[email protected]> | 2021-10-29 18:12:52 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-29 18:12:52 +0200 |
| commit | 6a5485ff81689d65e609dd3cbdfd9e8780bbe8b4 (patch) | |
| tree | ee05e7eead68a1ce0ca4c22d011e1614adb14de8 | |
| parent | Removed unused source files (diff) | |
| download | zen-6a5485ff81689d65e609dd3cbdfd9e8780bbe8b4.tar.xz zen-6a5485ff81689d65e609dd3cbdfd9e8780bbe8b4.zip | |
zenserver-test: Some modifications to avoid ODR violations
| -rw-r--r-- | zenserver-test/zenserver-test.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp index 23be9f729..f3849b2cd 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"; |