[Libreoffice-commits] core.git: sax/qa

Justin Luth justin_luth at sil.org
Wed Oct 12 18:12:42 UTC 2016


 sax/qa/cppunit/xmlimport.cxx |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit d9280e97c6e7b27742f26930af56b39a7d4edd75
Author: Justin Luth <justin_luth at sil.org>
Date:   Wed Oct 12 15:13:37 2016 +0300

    tdf#103159 allow compiling on 12.04 systems still
    
    "An uncaught exception of type com.sun.star.xml.sax.SAXParseException
     [internal line 13]: Namespace prefix manifest on file-entry is not defined"
    
    regression from 3aa52d36824d11b8774de15708fdfcbb93cd9dc3
    which states that "initialization parameter to FastParser will turn off
    the namespace declaration missing exception."
    
    However, although it doesn't RAISE the exception, it doesn't prevent it
    either.
    
    Change-Id: I26ea02444132e5370dcb4821a75181bc8c76e553
    Reviewed-on: https://gerrit.libreoffice.org/29731
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx
index 457f5f1..915f26e 100644
--- a/sax/qa/cppunit/xmlimport.cxx
+++ b/sax/qa/cppunit/xmlimport.cxx
@@ -432,18 +432,24 @@ void XMLImportTest::testMissingNamespaceDeclaration()
 
     for (sal_uInt16 i = 0; i < sizeof( fileNames ) / sizeof( OUString ); i++)
     {
-        InputSource source;
-        source.sSystemId    = "internal";
+        try
+        {
+            InputSource source;
+            source.sSystemId    = "internal";
 
-        source.aInputStream = createStreamFromFile( m_sDirPath + fileNames[i] );
-        m_xParser->parseStream(source);
-        const OUString rParserStr = m_xDocumentHandler->getString();
+            source.aInputStream = createStreamFromFile( m_sDirPath + fileNames[i] );
+            m_xParser->parseStream(source);
+            const OUString rParserStr = m_xDocumentHandler->getString();
 
-        source.aInputStream = createStreamFromFile( m_sDirPath + fileNames[i] );
-        m_xLegacyFastParser->parseStream(source);
-        const OUString rLegacyFastParserStr = m_xDocumentHandler->getString();
+            source.aInputStream = createStreamFromFile( m_sDirPath + fileNames[i] );
+            m_xLegacyFastParser->parseStream(source);
+            const OUString rLegacyFastParserStr = m_xDocumentHandler->getString();
 
-        CPPUNIT_ASSERT_EQUAL( rParserStr, rLegacyFastParserStr );
+            CPPUNIT_ASSERT_EQUAL( rParserStr, rLegacyFastParserStr );
+        }
+        catch( SAXException )
+        {
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list