diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-03 02:56:16 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-04 04:22:03 (GMT) |
commit | 5b86c4abc676b36d60e6625e89535e7f4907d2b3 (patch) | |
tree | 5c14db1db36c10a0a1e304fc8bfce913bd1395aa /tests | |
parent | 3ba55189d9aa7d9d7c2087071dcb4d338c0feab8 (diff) | |
download | Qt-5b86c4abc676b36d60e6625e89535e7f4907d2b3.zip Qt-5b86c4abc676b36d60e6625e89535e7f4907d2b3.tar.gz Qt-5b86c4abc676b36d60e6625e89535e7f4907d2b3.tar.bz2 |
Remove Q_ASSERT's from qsharedpointer autotest
Report a meaningful warning message into the test output rather than
aborting in debug mode and doing nothing in release mode.
Change-Id: I6883fccbce0139c763f36f6839bb3452d8f69c1c
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qsharedpointer/externaltests.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp index 1ba03dc..b0490c9 100644 --- a/tests/auto/qsharedpointer/externaltests.cpp +++ b/tests/auto/qsharedpointer/externaltests.cpp @@ -50,6 +50,7 @@ #include <QtCore/QDir> #include <QtCore/QDirIterator> #include <QtCore/QDateTime> +#include <QtCore/QDebug> #ifdef Q_OS_SYMBIAN #define DEFAULT_MAKESPEC "X:/STLsupport/mkspecs/symbian-abld/" @@ -342,7 +343,8 @@ namespace QTest { void QExternalTestPrivate::removeTemporaryDirectory() { - Q_ASSERT(!temporaryDir.isEmpty()); + if (temporaryDir.isEmpty()) + qWarning() << "Temporary directory is expected to be non-empty"; removeRecursive(temporaryDir); temporaryDir.clear(); } @@ -487,7 +489,8 @@ namespace QTest { bool QExternalTestPrivate::createProjectFile() { - Q_ASSERT(!temporaryDir.isEmpty()); + if (temporaryDir.isEmpty()) + qWarning() << "Temporary directory is expected to be non-empty"; QFile projectFile(temporaryDir + QLatin1String("/project.pro")); if (!projectFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) { @@ -599,7 +602,9 @@ namespace QTest { bool QExternalTestPrivate::runQmake() { - Q_ASSERT(!temporaryDir.isEmpty()); + if (temporaryDir.isEmpty()) + qWarning() << "Temporary directory is expected to be non-empty"; + if (!createProjectFile()) return false; @@ -633,7 +638,8 @@ namespace QTest { bool QExternalTestPrivate::runMake(Target target) { - Q_ASSERT(!temporaryDir.isEmpty()); + if (temporaryDir.isEmpty()) + qWarning() << "Temporary directory is expected to be non-empty"; QExternalProcess make; make.setWorkingDirectory(temporaryDir); |