diff options
-rw-r--r-- | sax/qa/cppunit/attributes.cxx | 11 | ||||
-rw-r--r-- | sax/qa/cppunit/parser.cxx | 11 |
2 files changed, 2 insertions, 20 deletions
diff --git a/sax/qa/cppunit/attributes.cxx b/sax/qa/cppunit/attributes.cxx index 716b7b2c2389..3697190277ee 100644 --- a/sax/qa/cppunit/attributes.cxx +++ b/sax/qa/cppunit/attributes.cxx @@ -22,8 +22,6 @@ namespace { class AttributesTest: public CppUnit::TestFixture { - bool mbException; - public: void test(); @@ -51,14 +49,7 @@ void AttributesTest::test() CPPUNIT_ASSERT_EQUAL( xAttributeList->getOptionalValue(3), OUString() ); CPPUNIT_ASSERT_EQUAL( xAttributeList->getValue(1), OUString("1") ); - mbException = false; - - try { xAttributeList->getValue(3); } - catch (const sax::SAXException& ) - { - mbException = true; - } - CPPUNIT_ASSERT( mbException ); + CPPUNIT_ASSERT_THROW( xAttributeList->getValue(3), xml::sax::SAXException ); xAttributeList->addUnknown("a", "a"); xAttributeList->addUnknown("b", "b", "b"); diff --git a/sax/qa/cppunit/parser.cxx b/sax/qa/cppunit/parser.cxx index e17538f707f4..5381f36e060d 100644 --- a/sax/qa/cppunit/parser.cxx +++ b/sax/qa/cppunit/parser.cxx @@ -92,16 +92,7 @@ void ParserTest::parse() mxParser->parseStream( maInput ); maInput.aInputStream = createStream("<b></a>"); - bool bException = false; - try - { - mxParser->parseStream( maInput ); - } - catch (const SAXParseException &) - { - bException = true; - } - CPPUNIT_ASSERT_MESSAGE("No Exception!", bException); + CPPUNIT_ASSERT_THROW( mxParser->parseStream( maInput ), css::xml::sax::SAXParseException ); } CPPUNIT_TEST_SUITE_REGISTRATION(ParserTest); |