diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-12-11 22:30:34 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-12-11 22:30:34 +0100 |
commit | d43b75cb459136e1d0c9df5447151069094f341d (patch) | |
tree | 6f9530760422ea4e5a2bdc68e7d008501c75716e /test | |
parent | 741463dd18efd8d126bcc70224025703858fdef7 (diff) |
implemented Logger.fork and corresponding LoggerFork class
Diffstat (limited to 'test')
-rw-r--r-- | test/core/common/LoggerTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/core/common/LoggerTest.cpp b/test/core/common/LoggerTest.cpp index bb31fa6..cc9f701 100644 --- a/test/core/common/LoggerTest.cpp +++ b/test/core/common/LoggerTest.cpp @@ -74,5 +74,29 @@ TEST(TerminalLogger, log) logger.logAt(Severity::ERROR, "This is a positioned log message", pos); } + +TEST(TerminalLogger, fork) +{ + // Test for manual visual expection only -- no assertions + TerminalLogger logger{std::cerr, true}; + + LoggerFork fork = logger.fork(); + + fork.pushFile("test.odp"); + fork.error("This is a test error with context", + TextCursor::Position{10, 20}, + TextCursor::Context{"int bla = blub;", 10, true, false}); + fork.pushFile("test2.odp"); + fork.error("This is a test error without context"); + fork.popFile(); + fork.error("Another error"); + fork.popFile(); + fork.error("Another error"); + + // Print all error messages + fork.commit(); +} + + } |