mirror of https://github.com/qt/qtbase.git
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 (cherry picked from commit 5b86c4abc676b36d60e6625e89535e7f4907d2b3)
This commit is contained in:
parent
982405f2d0
commit
44bb3c62cb
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue