diff --git a/tests/auto/core5/serialization/json/tst_qtjson.cpp b/tests/auto/core5/serialization/json/tst_qtjson.cpp index a631514..3d8a76e 100644 --- a/tests/auto/core5/serialization/json/tst_qtjson.cpp +++ b/tests/auto/core5/serialization/json/tst_qtjson.cpp @@ -45,7 +45,7 @@ void tst_QtJson::initTestCase() void tst_QtJson::fromBinary() { QFile file(testDataDir + "/test.json"); - file.open(QFile::ReadOnly); + QVERIFY(file.open(QFile::ReadOnly)); QByteArray testJson = file.readAll(); QJsonDocument doc = QJsonDocument::fromJson(testJson); @@ -54,7 +54,7 @@ void tst_QtJson::fromBinary() QCOMPARE(doc, outdoc); QFile bfile(testDataDir + "/test.bjson"); - bfile.open(QFile::ReadOnly); + QVERIFY(bfile.open(QFile::ReadOnly)); QByteArray binary = bfile.readAll(); QJsonDocument bdoc = QBinaryJson::fromBinaryData(binary); @@ -102,7 +102,7 @@ void tst_QtJson::invalidBinaryData() if (!files.at(i).isFile()) continue; QFile file(files.at(i).filePath()); - file.open(QIODevice::ReadOnly); + QVERIFY(file.open(QIODevice::ReadOnly)); QByteArray bytes = file.readAll(); bytes.squeeze(); QJsonDocument document = QBinaryJson::fromRawData(bytes.constData(), bytes.size()); @@ -209,7 +209,7 @@ void tst_QtJson::validation() QFile file2(testDataDir + "/test3.json"); - file2.open(QFile::ReadOnly); + QVERIFY(file2.open(QFile::ReadOnly)); testJson = file2.readAll(); QVERIFY(!testJson.isEmpty()); diff --git a/tests/benchmarks/core5/text/qregexp/main.cpp b/tests/benchmarks/core5/text/qregexp/main.cpp index c57af4d..afb5c58 100644 --- a/tests/benchmarks/core5/text/qregexp/main.cpp +++ b/tests/benchmarks/core5/text/qregexp/main.cpp @@ -23,6 +23,8 @@ class tst_qregexp : public QObject public: tst_qregexp(); private slots: + void initTestCase(); + void escape_old(); void escape_old_data() { escape_data(); } void escape_new1(); @@ -65,9 +67,13 @@ private: tst_qregexp::tst_qregexp() :QObject() ,str1("We are all happy monkeys") +{ +} + +void tst_qregexp::initTestCase() { QFile f(":/main.cpp"); - f.open(QFile::ReadOnly); + QVERIFY(f.open(QFile::ReadOnly)); str2=f.readAll(); }