1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Bug 459197 - C++ Unit Testing does not work with QT5

- change default behaviour on unknown tag to be just to log
  the unknown tag instead of throwing exception

Change-Id: Ia8880622ec3791ba546384edf536951b2c8c1edc
This commit is contained in:
Jeff Johnston 2017-05-08 17:48:44 -04:00
parent 26f81215ac
commit ca29390671

View file

@ -319,7 +319,7 @@ public class QtXmlLogHandler extends DefaultHandler {
/* just skip, do nothing */
} else {
logAndThrowErrorForElement(qName);
logUnknownTag(qName);
}
}
@ -359,7 +359,7 @@ public class QtXmlLogHandler extends DefaultHandler {
/* just skip, do nothing */
} else {
logAndThrowErrorForElement(qName);
logUnknownTag(qName);
}
elementData = null;
}
@ -379,12 +379,24 @@ public class QtXmlLogHandler extends DefaultHandler {
* @param tagName XML tag name
* @throws SAXException the exception that will be thrown
*/
@SuppressWarnings("unused")
private void logAndThrowErrorForElement(String tagName) throws SAXException {
logAndThrowError(
MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_wrong_tag_name, tagName)
);
}
/**
* Logs a message regarding an unknown XML tag.
*
* @param tagName XML tag name
*/
private void logUnknownTag(String tagName) {
QtTestsRunnerPlugin.log(new SAXException(
MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_wrong_tag_name, tagName))
);
}
/**
* Throws the testing exception with the specified message.
*