aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmljsscope
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmljsscope')
-rw-r--r--tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp b/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp
index 4acf27b173..60c0da78de 100644
--- a/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp
+++ b/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp
@@ -35,9 +35,9 @@ class tst_qqmljsscope : public QQmlDataTest
{
const QFileInfo fi(url);
QFile f(fi.absoluteFilePath());
- f.open(QIODevice::ReadOnly);
- QByteArray data(fi.size(), Qt::Uninitialized);
- f.read(data.data(), data.size());
+ if (!f.open(QIODevice::ReadOnly))
+ qFatal("Could not open file %s", qPrintable(url));
+ QByteArray data = f.readAll();
return QString::fromUtf8(data);
}