summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-06-13 20:45:12 +0200
committerlouiz’ <louiz@louiz.org>2016-06-13 20:46:30 +0200
commit550ab46f02511614d7ce7b46a4b4f63beae1aebc (patch)
tree95b3fe93d7c1ad8987f86e89924ae9bf0b5286db
parent5a2e61161792cf51209f240e40e28036195f35be (diff)
downloadbiboumi-550ab46f02511614d7ce7b46a4b4f63beae1aebc.tar.gz
biboumi-550ab46f02511614d7ce7b46a4b4f63beae1aebc.tar.bz2
biboumi-550ab46f02511614d7ce7b46a4b4f63beae1aebc.tar.xz
biboumi-550ab46f02511614d7ce7b46a4b4f63beae1aebc.zip
Make the logger tests more useful
-rw-r--r--tests/logger.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/logger.cpp b/tests/logger.cpp
index 7ae4f03..1d59a22 100644
--- a/tests/logger.cpp
+++ b/tests/logger.cpp
@@ -31,9 +31,9 @@ TEST_CASE("Basic logging")
WHEN("we log some errors")
{
IoTester<std::ostream> out(std::cout);
- log_error("error");
+ log_error("err", 12, "or");
THEN("error logs are written")
- CHECK(out.str() == error_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\terror\n");
+ CHECK(out.str() == error_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\terr12or\n");
}
}
GIVEN("A logger with log_level 3")
@@ -42,16 +42,16 @@ TEST_CASE("Basic logging")
WHEN("we log some debug text")
{
IoTester<std::ostream> out(std::cout);
- log_debug("debug");
+ log_debug(123, "debug");
THEN("nothing is written")
CHECK(out.str().empty());
}
WHEN("we log some errors")
{
IoTester<std::ostream> out(std::cout);
- log_error("error");
+ log_error(123, " errors");
THEN("error logs are still written")
- CHECK(out.str() == error_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\terror\n");
+ CHECK(out.str() == error_header + "tests/logger.cpp:" + std::to_string(__LINE__ - 2) + ":\t123 errors\n");
}
}
}