Add test for LoggerScope 17/33517/2
authorLukasz Kostyra <l.kostyra@samsung.com>
Wed, 17 Dec 2014 09:42:41 +0000 (10:42 +0100)
committerLukasz Kostyra <l.kostyra@samsung.com>
Mon, 12 Jan 2015 15:01:13 +0000 (16:01 +0100)
[Feature]       Test for new LoggerScope interface.
[Cause]         New interface in libLogger.
[Solution]      Test for new LoggerScope interface.
[Verification]  Build, install, run Log tests.

Change-Id: I43767c1f65d09ca8304046fd9d8586f1077a8b63

tests/unit_tests/log/ut-logger.cpp

index e574505..74028db 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.hpp"
 #include "ut.hpp"
 #include "logger/logger.hpp"
+#include "logger/logger-scope.hpp"
 #include "logger/formatter.hpp"
 #include "logger/backend.hpp"
 #include "logger/backend-stderr.hpp"
@@ -197,6 +198,19 @@ BOOST_AUTO_TEST_CASE(TestLogsTrace)
     BOOST_CHECK(tf.logContains("[TRACE]") == true);
 }
 
+BOOST_AUTO_TEST_CASE(TestLoggerScope)
+{
+    LOGS("Main function scope");
+
+    {
+        LOGS("Scope inside function");
+        LOGD("Some additional information in-between scoped logs");
+        {
+            LOGS("Additional scope with " << "stringstream" << ' ' << "test" << 3 << ' ' << 3.42);
+            LOGD("More additional information in-between scoped logs");
+        }
+    }
+}
 
 BOOST_AUTO_TEST_SUITE_END()