mirror of https://github.com/qt/qt5compat.git
Fix QFile::open() Easter Egg
Fix the delayed marking of QFile::open() as [[nodiscard]] in this module, too. Pick-to: 6.9 6.8 6.5 Change-Id: I7b1d76cc23c2ce1dfb8c03ca945dcecb6c54988f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
736f207cce
commit
2d8df31902
|
@ -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());
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue