Kaydet (Commit) 15a43283 authored tarafından Matúš Kukan's avatar Matúš Kukan Kaydeden (comit) Matúš Kukan

sax: use CPPUNIT_ASSERT_THROW

Change-Id: I34b0b559a91e77cc497e14d8ffad7e2c80e43d79
Reviewed-on: https://gerrit.libreoffice.org/21531Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMatúš Kukan <matus@libreoffice.org>
üst 1570957f
......@@ -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");
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment