mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
Compare commits
1 Commits
4xjtpd-cod
...
codex/fix-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0d5d8140ec |
@@ -15,10 +15,9 @@ TEST_CASE("ringbuffer stores formatted messages", "[ringbuffer]") {
|
|||||||
|
|
||||||
auto formatted = sink.last_formatted();
|
auto formatted = sink.last_formatted();
|
||||||
REQUIRE(formatted.size() == 3);
|
REQUIRE(formatted.size() == 3);
|
||||||
using spdlog::details::os::default_eol;
|
REQUIRE(formatted[0] == "msg1");
|
||||||
REQUIRE(formatted[0] == spdlog::fmt_lib::format("msg1{}", default_eol));
|
REQUIRE(formatted[1] == "msg2");
|
||||||
REQUIRE(formatted[1] == spdlog::fmt_lib::format("msg2{}", default_eol));
|
REQUIRE(formatted[2] == "msg3");
|
||||||
REQUIRE(formatted[2] == spdlog::fmt_lib::format("msg3{}", default_eol));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("ringbuffer overrun keeps last items", "[ringbuffer]") {
|
TEST_CASE("ringbuffer overrun keeps last items", "[ringbuffer]") {
|
||||||
@@ -31,9 +30,8 @@ TEST_CASE("ringbuffer overrun keeps last items", "[ringbuffer]") {
|
|||||||
|
|
||||||
auto formatted = sink.last_formatted();
|
auto formatted = sink.last_formatted();
|
||||||
REQUIRE(formatted.size() == 2);
|
REQUIRE(formatted.size() == 2);
|
||||||
using spdlog::details::os::default_eol;
|
REQUIRE(formatted[0] == "second");
|
||||||
REQUIRE(formatted[0] == spdlog::fmt_lib::format("second{}", default_eol));
|
REQUIRE(formatted[1] == "third");
|
||||||
REQUIRE(formatted[1] == spdlog::fmt_lib::format("third{}", default_eol));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("ringbuffer retrieval limit", "[ringbuffer]") {
|
TEST_CASE("ringbuffer retrieval limit", "[ringbuffer]") {
|
||||||
@@ -46,8 +44,7 @@ TEST_CASE("ringbuffer retrieval limit", "[ringbuffer]") {
|
|||||||
|
|
||||||
auto formatted = sink.last_formatted(2);
|
auto formatted = sink.last_formatted(2);
|
||||||
REQUIRE(formatted.size() == 2);
|
REQUIRE(formatted.size() == 2);
|
||||||
using spdlog::details::os::default_eol;
|
REQUIRE(formatted[0] == "B");
|
||||||
REQUIRE(formatted[0] == spdlog::fmt_lib::format("B{}", default_eol));
|
REQUIRE(formatted[1] == "C");
|
||||||
REQUIRE(formatted[1] == spdlog::fmt_lib::format("C{}", default_eol));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user