mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
Ported pull #3023 with some changes and tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "includes.h"
|
||||
#include <string_view>
|
||||
#include "spdlog/sinks/daily_file_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
@@ -106,3 +107,24 @@ TEST_CASE("disable automatic registration", "[registry]") {
|
||||
spdlog::set_level(spdlog::level::info);
|
||||
spdlog::set_automatic_registration(true);
|
||||
}
|
||||
|
||||
TEST_CASE("get(const char* name)", "[registry]") {
|
||||
spdlog::drop_all();
|
||||
spdlog::create<spdlog::sinks::null_sink_mt>(tested_logger_name);
|
||||
REQUIRE(spdlog::get(tested_logger_name) != nullptr);
|
||||
spdlog::drop_all();
|
||||
}
|
||||
|
||||
TEST_CASE("get(std::string_view name)", "[registry]") {
|
||||
spdlog::drop_all();
|
||||
spdlog::create<spdlog::sinks::null_sink_mt>(tested_logger_name);
|
||||
REQUIRE(spdlog::get(std::string_view(tested_logger_name)) != nullptr);
|
||||
spdlog::drop_all();
|
||||
}
|
||||
|
||||
TEST_CASE("get(std::string name)", "[registry]") {
|
||||
spdlog::drop_all();
|
||||
spdlog::create<spdlog::sinks::null_sink_mt>(tested_logger_name);
|
||||
REQUIRE(spdlog::get(std::string(tested_logger_name)) != nullptr);
|
||||
spdlog::drop_all();
|
||||
}
|
||||
|
Reference in New Issue
Block a user