summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-02-02 19:18:26 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-02-03 04:34:08 +0100
commitc7a52d9d5404038dab8a68bd57cd37aecf3f906f (patch)
tree1fa7aaf5ee8ec141947b2f7b886e42712fd2e0cf /src/testlib
parente7d627339cc35907c0d5bb263ede10a017e0b988 (diff)
QTestLib: code tidies
Rename the `failureLocation` variable to `messageLocation`, as it does not necessarily contain information about a failure. Change-Id: I9e78dc76c8111c78e34c36f6623e9a8cc9e4764e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qplaintestlogger.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index eee6055fea..19d615b157 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -235,7 +235,7 @@ void QPlainTestLogger::printMessage(MessageSource source, const char *type, cons
QTestCharBuffer messagePrefix;
- QTestCharBuffer failureLocation;
+ QTestCharBuffer messageLocation;
#ifdef Q_OS_WIN
constexpr const char *INCIDENT_LOCATION_STR = "\n%s(%d) : failure location";
constexpr const char *OTHER_LOCATION_STR = "\n%s(%d) : message location";
@@ -247,10 +247,10 @@ void QPlainTestLogger::printMessage(MessageSource source, const char *type, cons
if (file) {
switch (source) {
case MessageSource::Incident:
- QTest::qt_asprintf(&failureLocation, INCIDENT_LOCATION_STR, file, line);
+ QTest::qt_asprintf(&messageLocation, INCIDENT_LOCATION_STR, file, line);
break;
case MessageSource::Other:
- QTest::qt_asprintf(&failureLocation, OTHER_LOCATION_STR, file, line);
+ QTest::qt_asprintf(&messageLocation, OTHER_LOCATION_STR, file, line);
break;
}
}
@@ -259,7 +259,7 @@ void QPlainTestLogger::printMessage(MessageSource source, const char *type, cons
QTestCharBuffer testIdentifier;
QTestPrivate::generateTestIdentifier(&testIdentifier);
QTest::qt_asprintf(&messagePrefix, "%s: %s%s%s%s\n",
- type, testIdentifier.data(), msgFiller, msg, failureLocation.data());
+ type, testIdentifier.data(), msgFiller, msg, messageLocation.data());
// In colored mode, printf above stripped our nonprintable control characters.
// Put them back.