summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlstream
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-10 01:43:08 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-10 05:55:58 (GMT)
commit4793c3bd1dfddcc98eae12e5caf29ff6aabd31b2 (patch)
tree33d3258fe504cb611becf1dc2a4abd0ff42e4736 /tests/auto/qxmlstream
parent984a72a8bbf853059f0eb7e1054538b48d5f3bc8 (diff)
downloadQt-4793c3bd1dfddcc98eae12e5caf29ff6aabd31b2.zip
Qt-4793c3bd1dfddcc98eae12e5caf29ff6aabd31b2.tar.gz
Qt-4793c3bd1dfddcc98eae12e5caf29ff6aabd31b2.tar.bz2
Remove Q_ASSERT's from QXmlStream autotest
Report fatal errors rather than ignoring them in non-debug builds. Change-Id: I62dd177e2f391e64c12314bf224f8952ed6f3144 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qxmlstream')
-rw-r--r--tests/auto/qxmlstream/tst_qxmlstream.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/auto/qxmlstream/tst_qxmlstream.cpp b/tests/auto/qxmlstream/tst_qxmlstream.cpp
index 5324264..946a19a 100644
--- a/tests/auto/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/qxmlstream/tst_qxmlstream.cpp
@@ -264,7 +264,8 @@ public:
expected(aExpected),
output(aOutput)
{
- Q_ASSERT(!aId.isEmpty());
+ if (aId.isEmpty())
+ qFatal("%s: aId must not be an empty string", Q_FUNC_INFO);
}
QString id;
@@ -288,7 +289,8 @@ public:
TestSuiteHandler(const QUrl &baseURI) : runCount(0),
skipCount(0)
{
- Q_ASSERT(baseURI.isValid());
+ if (!baseURI.isValid())
+ qFatal("%s: baseURI must be valid", Q_FUNC_INFO);
m_baseURI.push(baseURI);
}
@@ -480,9 +482,12 @@ public:
static bool isWellformed(QIODevice *const inputFile, const ParseMode mode)
{
- Q_ASSERT(inputFile);
- Q_ASSERT_X(inputFile->isOpen(), Q_FUNC_INFO, "The caller is responsible for opening the device.");
- Q_ASSERT(mode == ParseIncrementally || mode == ParseSinglePass);
+ if (!inputFile)
+ qFatal("%s: inputFile must be a valid QIODevice pointer", Q_FUNC_INFO);
+ if (!inputFile->isOpen())
+ qFatal("%s: inputFile must be opened by the caller", Q_FUNC_INFO);
+ if (mode != ParseIncrementally && mode != ParseSinglePass)
+ qFatal("%s: mode must be either ParseIncrementally or ParseSinglePass", Q_FUNC_INFO);
if(mode == ParseIncrementally)
{