Remove Q_ASSERT's from qabstractfileengine test

Rather than aborting in debug builds and failing silently in release
builds, report a meaningful warning message and skip setting the
filename, which should cause a subsequent test failure.

Change-Id: I3ae4f4de7b02bf2194019047fa87d8ae06d95634
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit e6f7509f18ae88069373d59073cbdcda88fd19c8)
This commit is contained in:
Jason McDonald 2011-05-06 13:12:10 +10:00 committed by Rohan McGovern
parent 97e0db61c7
commit 51b23f75df

View File

@ -360,10 +360,10 @@ public:
void setFileName(const QString &file)
{
Q_ASSERT(!openForRead_);
Q_ASSERT(!openForWrite_);
fileName_ = file;
if (openForRead_ || openForWrite_)
qWarning("%s: Can't set file name while file is open", Q_FUNC_INFO);
else
fileName_ = file;
}
// typedef QAbstractFileEngineIterator Iterator;