summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp2
-rw-r--r--src/testlib/qtestcase.cpp8
-rw-r--r--src/testlib/qxctestlogger.mm2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index ada3cfc768..7cb5eef30c 100644
--- a/src/testlib/qbenchmarkvalgrind.cpp
+++ b/src/testlib/qbenchmarkvalgrind.cpp
@@ -96,7 +96,7 @@ qint64 QBenchmarkValgrindUtils::extractResult(const QString &fileName)
break;
}
}
- if (!valSeen)
+ if (Q_UNLIKELY(!valSeen))
qFatal("Failed to extract result");
return val;
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 0847d639fd..f5f399978e 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2132,7 +2132,7 @@ public:
int t = timeout.load();
if (!t)
break;
- if (!waitCondition.wait(&mutex, t)) {
+ if (Q_UNLIKELY(!waitCondition.wait(&mutex, t))) {
stackTrace();
qFatal("Test function timed out");
}
@@ -2256,12 +2256,12 @@ void *fetchData(QTestData *data, const char *tagName, int typeId)
int idx = data->parent()->indexOf(tagName);
- if (idx == -1 || idx >= data->dataCount()) {
+ if (Q_UNLIKELY(idx == -1 || idx >= data->dataCount())) {
qFatal("QFETCH: Requested testdata '%s' not available, check your _data function.",
tagName);
}
- if (typeId != data->parent()->elementTypeId(idx)) {
+ if (Q_UNLIKELY(typeId != data->parent()->elementTypeId(idx))) {
qFatal("Requested type '%s' does not match available type '%s'.",
QMetaType::typeName(typeId),
QMetaType::typeName(data->parent()->elementTypeId(idx)));
@@ -2940,7 +2940,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
#ifdef QTESTLIB_USE_VALGRIND
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
- if (!qApp)
+ if (Q_UNLIKELY(!qApp))
qFatal("QtTest: -callgrind option is not available with QTEST_APPLESS_MAIN");
const QStringList origAppArgs(QCoreApplication::arguments());
diff --git a/src/testlib/qxctestlogger.mm b/src/testlib/qxctestlogger.mm
index 34116a2670..1e9119c9c0 100644
--- a/src/testlib/qxctestlogger.mm
+++ b/src/testlib/qxctestlogger.mm
@@ -124,7 +124,7 @@ private:
if (![XCTestProbe isTesting])
return;
- if (!([NSDate timeIntervalSinceReferenceDate] > 0))
+ if (Q_UNLIKELY(!([NSDate timeIntervalSinceReferenceDate] > 0)))
qFatal("error: Device date '%s' is bad, likely set to update automatically. Please correct.",
[[NSDate date] description].UTF8String);