mirror of https://github.com/qt/qtgraphs.git
Baseline test: fix warning from unused QFile::open result
As in other baseline test implementations, exit with a fatal
message when the reference file cannot be opened.
Change-Id: I112f3ed3bfa57af17eab91357dd0056e7b5c5585
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 8092e44167)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
62fef14aa6
commit
47d06d0d61
|
|
@ -214,7 +214,8 @@ quint16 tst_Graphs::checksumFileOrDir(const QString &path)
|
|||
if (fi.isFile()) {
|
||||
QFile f(path);
|
||||
bool isBinary = path.endsWith(".png") || path.endsWith(".jpg");
|
||||
f.open(isBinary ? QIODevice::ReadOnly : QIODevice::ReadOnly | QIODevice::Text);
|
||||
if (!f.open(isBinary ? QIODevice::ReadOnly : QIODevice::ReadOnly | QIODevice::Text))
|
||||
qFatal("Could not open file %s", qPrintable(path));
|
||||
QByteArray contents = f.readAll();
|
||||
return qChecksum(contents);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue