Make tst_QTemporaryFile::fileTemplate() more informative on failure

A QCOMPARE(..., true) isn't much use; and failure would have set the
object's .errorString(), which seems like it'd be worth reporting, so
use QVERIFY2() instead.

Change-Id: I2f3f9379984694891de81d2ffebc696d91eec70f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2019-03-18 18:30:33 +01:00
parent 84aea6c091
commit 3c4e202fe4

View File

@ -215,7 +215,7 @@ void tst_QTemporaryFile::fileTemplate()
if (!fileTemplate.isEmpty())
file.setFileTemplate(fileTemplate);
QCOMPARE(file.open(), true);
QVERIFY2(file.open(), qPrintable(file.errorString()));
QString fileName = QFileInfo(file).fileName();
if (prefix.length())