From 550ab46f02511614d7ce7b46a4b4f63beae1aebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 13 Jun 2016 20:45:12 +0200 Subject: Make the logger tests more useful --- tests/logger.cpp | 10 +++++----- 1 file 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 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 out(std::cout); - log_debug("debug"); + log_debug(123, "debug"); THEN("nothing is written") CHECK(out.str().empty()); } WHEN("we log some errors") { IoTester 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"); } } } -- cgit v1.2.3