summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2024-03-22 17:32:44 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2024-04-04 12:24:18 +0100
commit62e91d0025d4a039df0375190a6b93f98e2e7c35 (patch)
tree10011b5366f9efb621efc897c051e0d1ee73992b /src
parent3c6598c359a99eaef47fdcac2cbdd4441946ef0b (diff)
QBenchmark: abort if we can't open the output file
Change-Id: I6391bb8e6fb0a336d1df82c30eb07ec931cfc053 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index 253108bd9d..bea3066e66 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);
}