mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
Cleaned tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#define SPDLOG_SOURCE_LOCATION
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/ostream_sink.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
#if defined(SPDLOG_HAVE_STD_SOURCE_LOCATION) || defined(SPDLOG_HAVE_EXPERIMENTAL_SOURCE_LOCATION)
|
||||
@@ -11,9 +12,10 @@ TEST_CASE("test_source_location", "[source_location]") {
|
||||
auto oss_sink = std::make_shared<spdlog::sinks::ostream_sink_st>(oss);
|
||||
spdlog::logger oss_logger("oss", oss_sink);
|
||||
oss_logger.set_pattern("%s:%# %v");
|
||||
|
||||
oss_logger.info("Hello {}", "source location");
|
||||
REQUIRE(oss.str() ==
|
||||
std::string("test_source_location.cpp:14 Hello source location") + default_eol);
|
||||
std::string("test_source_location.cpp:16 Hello source location") + default_eol);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user