From 0b4711c86e97fa81265d0e0ef29027d5795ee8d9 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 1 Jan 2015 15:13:02 +0100 Subject: Adapted unit tests --- test/plugins/xml/XmlParserTest.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'test/plugins/xml') diff --git a/test/plugins/xml/XmlParserTest.cpp b/test/plugins/xml/XmlParserTest.cpp index 39b1a9d..c5a7b10 100644 --- a/test/plugins/xml/XmlParserTest.cpp +++ b/test/plugins/xml/XmlParserTest.cpp @@ -20,12 +20,16 @@ #include +#include + #include namespace ousia { namespace parser { namespace xml { +TerminalLogger logger(std::cerr, true); + TEST(XmlParser, mismatchedTagException) { StandaloneParserContext ctx; @@ -35,8 +39,8 @@ TEST(XmlParser, mismatchedTagException) try { p.parse("\n", ctx); } - catch (ParserException ex) { - ASSERT_EQ(2U, ex.pos.line); + catch (LoggableException ex) { + ASSERT_EQ(2U, ex.loc.line); hadException = true; } ASSERT_TRUE(hadException); @@ -47,8 +51,10 @@ const char *TEST_DATA = "\n" " \n" " \n" - " \n" - " \n" + " \n" + " \n" + " \n" + " \n" " \n" " \n" " \n" @@ -58,10 +64,14 @@ const char *TEST_DATA = TEST(XmlParser, namespaces) { - StandaloneParserContext ctx; + StandaloneParserContext ctx(logger); XmlParser p; - p.parse(TEST_DATA, ctx); + try { + p.parse(TEST_DATA, ctx); + } catch(LoggableException ex) { + logger.log(ex); + } } } } -- cgit v1.2.3