diff options
author | Giuseppe D'Angelo <[email protected]> | 2024-03-22 17:32:44 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <[email protected]> | 2024-04-04 12:24:18 +0100 |
commit | 62e91d0025d4a039df0375190a6b93f98e2e7c35 (patch) | |
tree | 10011b5366f9efb621efc897c051e0d1ee73992b | |
parent | 3c6598c359a99eaef47fdcac2cbdd4441946ef0b (diff) |
QBenchmark: abort if we can't open the output file
Change-Id: I6391bb8e6fb0a336d1df82c30eb07ec931cfc053
Reviewed-by: Ahmad Samir <[email protected]>
-rw-r--r-- | src/testlib/qbenchmarkvalgrind.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 253108bd9db..bea3066e66e 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -45,7 +45,10 @@ bool QBenchmarkValgrindUtils::rerunThroughCallgrind(const QStringList &origAppAr static void dumpOutput(const QByteArray &data, FILE *fh) { QFile file; - file.open(fh, QIODevice::WriteOnly); + if (!file.open(fh, QIODevice::WriteOnly)) { + qFatal("Could not open filehandle for dumping output: %s", + qPrintable(file.errorString())); + } file.write(data); } |