mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-27 03:00:46 +08:00
Fixed soruce_loc test
This commit is contained in:
parent
64a013fd16
commit
c7fc302710
@ -5,7 +5,6 @@
|
||||
#include "includes.h"
|
||||
#include "test_sink.h"
|
||||
|
||||
|
||||
// test with source location
|
||||
TEST_CASE("test_source_location", "[source_location]") {
|
||||
auto test_sink = std::make_shared<spdlog::sinks::test_sink_mt>();
|
||||
@ -14,11 +13,11 @@ TEST_CASE("test_source_location", "[source_location]") {
|
||||
// test with source location with parameters
|
||||
SPDLOG_LOGGER_CALL(logger, spdlog::level::info, "Hello {}", "source location");
|
||||
REQUIRE(test_sink->lines().size() == 1);
|
||||
REQUIRE(test_sink->lines()[0] == "test_source_location.cpp:15 Hello source location");
|
||||
REQUIRE(test_sink->lines()[0] == "test_source_location.cpp:14 Hello source location");
|
||||
// test with source location without parameters
|
||||
SPDLOG_LOGGER_CALL(logger, spdlog::level::info, "Hello");
|
||||
REQUIRE(test_sink->lines().size() == 2);
|
||||
REQUIRE(test_sink->lines()[1] == "test_source_location.cpp:19 Hello");
|
||||
REQUIRE(test_sink->lines()[1] == "test_source_location.cpp:18 Hello");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user