From 300465355be4b979ce8289a98c4d43a62191f9e9 Mon Sep 17 00:00:00 2001
From: Olivier Stasse <ostasse@laas.fr>
Date: Mon, 15 Apr 2019 22:33:48 +0200
Subject: [PATCH] [unitTesting] Testing sendMsg with __FILE__ and __LINE__ The
 logger is implemented with a map using __FILE__ and __LINE__. Using the
 defaut values means that the same counter is used for all the streams. This
 is jeopardizing the test.

---
 unitTesting/custom_entity.cpp | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/unitTesting/custom_entity.cpp b/unitTesting/custom_entity.cpp
index 12e9fd7..5a0e0af 100644
--- a/unitTesting/custom_entity.cpp
+++ b/unitTesting/custom_entity.cpp
@@ -57,15 +57,24 @@ namespace dynamicgraph
       std::ostringstream oss;
       oss << "start update " << res;
       sendMsg(oss.str().c_str(),MSG_TYPE_ERROR);
-      sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG);
-      sendMsg("This is a message of level MSG_TYPE_INFO",MSG_TYPE_INFO);
-      sendMsg("This is a message of level MSG_TYPE_WARNING",MSG_TYPE_WARNING);
-      sendMsg("This is a message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR);
-      sendMsg("This is a message of level MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM);
-      sendMsg("This is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM);
-      sendMsg("This is a message of level MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM);
-      sendMsg("This is a message of level MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM);
-      sendMsg("end update",MSG_TYPE_ERROR);
+      sendMsg("This is a message of level MSG_TYPE_DEBUG",
+	      MSG_TYPE_DEBUG,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_INFO",
+	      MSG_TYPE_INFO,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_WARNING",
+	      MSG_TYPE_WARNING,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_ERROR",
+	      MSG_TYPE_ERROR,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_DEBUG_STREAM",
+	      MSG_TYPE_DEBUG_STREAM,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_INFO_STREAM",
+	      MSG_TYPE_INFO_STREAM,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_WARNING_STREAM",
+	      MSG_TYPE_WARNING_STREAM,__FILE__,__LINE__);
+      sendMsg("This is a message of level MSG_TYPE_ERROR_STREAM",
+	      MSG_TYPE_ERROR_STREAM,__FILE__,__LINE__);
+      sendMsg("end update",
+	      MSG_TYPE_ERROR,__FILE__,__LINE__);
       return res;
     }
 
-- 
GitLab