summaryrefslogtreecommitdiffstats
path: root/tests/auto/qabstractfileengine
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-06 03:12:10 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-06 07:10:06 (GMT)
commite6f7509f18ae88069373d59073cbdcda88fd19c8 (patch)
treed7e9478cf17b2e4f5d5966f01bcc146f6c30438a /tests/auto/qabstractfileengine
parent11254ff409395b67cb28453b3c069860bc28c14d (diff)
downloadQt-e6f7509f18ae88069373d59073cbdcda88fd19c8.zip
Qt-e6f7509f18ae88069373d59073cbdcda88fd19c8.tar.gz
Qt-e6f7509f18ae88069373d59073cbdcda88fd19c8.tar.bz2
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
Diffstat (limited to 'tests/auto/qabstractfileengine')
-rw-r--r--tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
index fc4835a..e77b7bb 100644
--- a/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
+++ b/tests/auto/qabstractfileengine/tst_qabstractfileengine.cpp
@@ -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;