From 253497b7446c7d723aa3bdd7152e25d6852f2604 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 4 Oct 2011 13:23:23 +1000 Subject: Avoid using QSKIP in lieu of compile-time checks QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: I582732e3dd657df834f9a98fd52d7ee368f2f29b Reviewed-on: http://codereview.qt-project.org/5946 Reviewed-by: Qt Sanity Bot Reviewed-by: Rohan McGovern --- tests/auto/xml/sax/qxml/tst_qxml.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/xml/sax') diff --git a/tests/auto/xml/sax/qxml/tst_qxml.cpp b/tests/auto/xml/sax/qxml/tst_qxml.cpp index 7b62b3deb8..5fd8793f19 100644 --- a/tests/auto/xml/sax/qxml/tst_qxml.cpp +++ b/tests/auto/xml/sax/qxml/tst_qxml.cpp @@ -57,7 +57,9 @@ Q_OBJECT private slots: void getSetCheck(); void interpretedAs0D() const; +#ifndef QT_NO_EXCEPTIONS void exception(); +#endif }; class MyXmlEntityResolver : public QXmlEntityResolver @@ -214,9 +216,9 @@ void tst_QXml::interpretedAs0D() const QCOMPARE(myHandler.attrName, QChar(0x010D) + QString::fromLatin1("reated-by")); } +#ifndef QT_NO_EXCEPTIONS void tst_QXml::exception() { -#ifndef QT_NO_EXCEPTIONS QString message = QString::fromLatin1("message"); int column = 3; int line = 2; @@ -234,10 +236,8 @@ void tst_QXml::exception() QCOMPARE(e.publicId(), publicId); QCOMPARE(e.systemId(), systemId); } -#else - QSKIP("Exceptions not available", SkipAll); -#endif } +#endif QTEST_MAIN(tst_QXml) #include "tst_qxml.moc" -- cgit v1.2.3