summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@theqtcompany.com>2016-04-11 10:55:30 +0200
committerJesus Fernandez <jesus.fernandez@theqtcompany.com>2016-04-12 10:18:57 +0000
commit0f7171f290f0d137b4034c617d4c1fd169079209 (patch)
tree74478af9dce75d426b4453b121db77dd84105bad /tests/auto/corelib/io/qfile
parent5f41d344e9d66434be13a9644b4da08dd01974a9 (diff)
Better error message when trying to load an invalid resource
Before this change QFile::errorString function was returning an "Unknown error". Now it will return the typical ENOENT string. Task-number: QTBUG-45259 Change-Id: Ib7634f1aa5d91f77151cf92c58d3956e20a4cc6b Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/io/qfile')
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 1c695a1113..b1e383dda1 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -543,6 +543,10 @@ void tst_QFile::open_data()
<< false << QFile::OpenError;
QTest::newRow("noreadfile") << QString::fromLatin1(noReadFile) << int(QIODevice::ReadOnly)
<< false << QFile::OpenError;
+ QTest::newRow("resource_file") << QString::fromLatin1(":/does/not/exist")
+ << int(QIODevice::ReadOnly)
+ << false
+ << QFile::OpenError;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
//opening devices requires administrative privileges (and elevation).
HANDLE hTest = CreateFile(_T("\\\\.\\PhysicalDrive0"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);