mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
clang-format
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
using filename_memory_buf_t = spdlog::memory_buf_t;
|
||||
|
||||
|
||||
TEST_CASE("daily_logger with dateonly calculator", "[daily_logger]") {
|
||||
using sink_type = spdlog::sinks::daily_file_sink<std::mutex, spdlog::sinks::daily_filename_calculator>;
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
#ifdef _WIN32 // to prevent fopen warning on windows
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#ifdef _WIN32 // to prevent fopen warning on windows
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "spdlog/details/os.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
|
||||
template <class T>
|
||||
std::string log_info(const T &what, spdlog::level logger_level = spdlog::level::info) {
|
||||
std::string log_info(const T& what, spdlog::level logger_level = spdlog::level::info) {
|
||||
std::ostringstream oss;
|
||||
auto oss_sink = std::make_shared<spdlog::sinks::ostream_sink_mt>(oss);
|
||||
|
||||
@@ -176,17 +176,18 @@ TEST_CASE("utf8 to utf16 conversion using windows api", "[windows utf]") {
|
||||
spdlog::details::os::utf8_to_wstrbuf("abc", buffer);
|
||||
REQUIRE(std::wstring(buffer.data(), buffer.size()) == std::wstring(L"abc"));
|
||||
|
||||
spdlog::details::os::utf8_to_wstrbuf("\xc3\x28", buffer); // Invalid UTF-8 sequence.
|
||||
spdlog::details::os::utf8_to_wstrbuf("\xc3\x28", buffer); // Invalid UTF-8 sequence.
|
||||
REQUIRE(std::wstring(buffer.data(), buffer.size()) == std::wstring(L"\xfffd("));
|
||||
|
||||
spdlog::details::os::utf8_to_wstrbuf("\xe3\x81\xad\xe3\x81\x93", buffer); // "Neko" in hiragana.
|
||||
spdlog::details::os::utf8_to_wstrbuf("\xe3\x81\xad\xe3\x81\x93", buffer); // "Neko" in hiragana.
|
||||
REQUIRE(std::wstring(buffer.data(), buffer.size()) == std::wstring(L"\x306d\x3053"));
|
||||
}
|
||||
#endif
|
||||
|
||||
struct auto_closer {
|
||||
FILE* fp = nullptr;
|
||||
explicit auto_closer(FILE* f) : fp(f) {}
|
||||
explicit auto_closer(FILE* f)
|
||||
: fp(f) {}
|
||||
auto_closer(const auto_closer&) = delete;
|
||||
auto_closer& operator=(const auto_closer&) = delete;
|
||||
~auto_closer() {
|
||||
@@ -194,13 +195,11 @@ struct auto_closer {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
TEST_CASE("os::fwrite_bytes", "[os]") {
|
||||
|
||||
using spdlog::details::os::fwrite_bytes;
|
||||
using spdlog::details::os::create_dir;
|
||||
using spdlog::details::os::fwrite_bytes;
|
||||
const char* filename = "log_tests/test_fwrite_bytes.txt";
|
||||
const char *msg = "hello";
|
||||
const char* msg = "hello";
|
||||
prepare_logdir();
|
||||
REQUIRE(create_dir("log_tests"));
|
||||
{
|
||||
|
Reference in New Issue
Block a user