BenchmarkQtJson: print errorString() on QFile::open() failure
Amends 1c3ee86f183d46709c070ccd44970e05dc70f83d. Pick-to: 6.8 6.5 Change-Id: Iaffdbd43fc182a46e1280bc7e023083bbea4a285 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 5b52814d643e2a38581850293610acc2d0ee4c69)
This commit is contained in:
parent
b91da6c943
commit
7fc08a8a68
@ -56,7 +56,7 @@ void BenchmarkQtJson::parseNumbers()
|
|||||||
QString testFile = QFINDTESTDATA("numbers.json");
|
QString testFile = QFINDTESTDATA("numbers.json");
|
||||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file numbers.json!");
|
QVERIFY2(!testFile.isEmpty(), "cannot find test file numbers.json!");
|
||||||
QFile file(testFile);
|
QFile file(testFile);
|
||||||
QVERIFY2(file.open(QFile::ReadOnly), "cannot open test file number.json!");
|
QVERIFY2(file.open(QFile::ReadOnly), qPrintable(file.errorString()));
|
||||||
QByteArray testJson = file.readAll();
|
QByteArray testJson = file.readAll();
|
||||||
|
|
||||||
QBENCHMARK {
|
QBENCHMARK {
|
||||||
@ -70,7 +70,7 @@ void BenchmarkQtJson::parseJson()
|
|||||||
QString testFile = QFINDTESTDATA("test.json");
|
QString testFile = QFINDTESTDATA("test.json");
|
||||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
|
QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
|
||||||
QFile file(testFile);
|
QFile file(testFile);
|
||||||
QVERIFY2(file.open(QFile::ReadOnly), "cannot open test file test.json!");
|
QVERIFY2(file.open(QFile::ReadOnly), qPrintable(file.errorString()));
|
||||||
QByteArray testJson = file.readAll();
|
QByteArray testJson = file.readAll();
|
||||||
|
|
||||||
QBENCHMARK {
|
QBENCHMARK {
|
||||||
@ -84,7 +84,7 @@ void BenchmarkQtJson::parseJsonToVariant()
|
|||||||
QString testFile = QFINDTESTDATA("test.json");
|
QString testFile = QFINDTESTDATA("test.json");
|
||||||
QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
|
QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
|
||||||
QFile file(testFile);
|
QFile file(testFile);
|
||||||
QVERIFY2(file.open(QFile::ReadOnly), "cannot open test file test.json!");
|
QVERIFY2(file.open(QFile::ReadOnly), qPrintable(file.errorString()));
|
||||||
QByteArray testJson = file.readAll();
|
QByteArray testJson = file.readAll();
|
||||||
|
|
||||||
QBENCHMARK {
|
QBENCHMARK {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user