diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-05 12:36:05 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-05 12:36:05 +0100 |
commit | 9cb01624a4efe2063d5870f41e033476d9368b6d (patch) | |
tree | f1274db2a713f11780d13f94ddff0dbde9805be9 /test/core/LoggerTest.cpp | |
parent | 0a4fbfe17951498f9a5f650f6da81d90f4a533b4 (diff) | |
parent | a23c51bcb1b8d85b1ea06a7a16729fa4b87d8fd4 (diff) |
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'test/core/LoggerTest.cpp')
-rw-r--r-- | test/core/LoggerTest.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/core/LoggerTest.cpp b/test/core/LoggerTest.cpp index 7031dc7..b4549ed 100644 --- a/test/core/LoggerTest.cpp +++ b/test/core/LoggerTest.cpp @@ -24,6 +24,13 @@ namespace ousia { +struct Pos { + int line, column; + Pos(int line, int column) : line(line), column(column) {}; + int getLine() const { return line; } + int getColumn() const { return column; } +}; + TEST(TerminalLogger, log) { // Test for manual visual expection only -- no assertions @@ -34,8 +41,11 @@ TEST(TerminalLogger, log) logger.debug("This is a test debug message with no column", 10); logger.debug("This is a test debug message with no line"); logger.debug("This is a test debug message with no file", ""); - logger.debug("This is a test debug message with no file but a line", "", 10); - logger.debug("This is a test debug message with no file but a line and a column", "", 10, 20); + logger.debug("This is a test debug message with no file but a line", "", + 10); + logger.debug( + "This is a test debug message with no file but a line and a column", "", + 10, 20); logger.note("This is a test note", 10, 20); logger.warning("This is a test warning", 10, 20); logger.error("This is a test error", 10, 20); @@ -43,10 +53,12 @@ TEST(TerminalLogger, log) try { throw LoggableException{"A fatal exception"}; - } catch (const LoggableException &ex) { + } + catch (const LoggableException &ex) { logger.log(ex); } -} + logger.logAt(Severity::ERROR, "This is a positioned error", Pos(10, 20)); +} } |