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>
This commit is contained in:
parent
e7d627339c
commit
c7a52d9d54
@ -235,7 +235,7 @@ void QPlainTestLogger::printMessage(MessageSource source, const char *type, cons
|
|||||||
|
|
||||||
QTestCharBuffer messagePrefix;
|
QTestCharBuffer messagePrefix;
|
||||||
|
|
||||||
QTestCharBuffer failureLocation;
|
QTestCharBuffer messageLocation;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
constexpr const char *INCIDENT_LOCATION_STR = "\n%s(%d) : failure location";
|
constexpr const char *INCIDENT_LOCATION_STR = "\n%s(%d) : failure location";
|
||||||
constexpr const char *OTHER_LOCATION_STR = "\n%s(%d) : message 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) {
|
if (file) {
|
||||||
switch (source) {
|
switch (source) {
|
||||||
case MessageSource::Incident:
|
case MessageSource::Incident:
|
||||||
QTest::qt_asprintf(&failureLocation, INCIDENT_LOCATION_STR, file, line);
|
QTest::qt_asprintf(&messageLocation, INCIDENT_LOCATION_STR, file, line);
|
||||||
break;
|
break;
|
||||||
case MessageSource::Other:
|
case MessageSource::Other:
|
||||||
QTest::qt_asprintf(&failureLocation, OTHER_LOCATION_STR, file, line);
|
QTest::qt_asprintf(&messageLocation, OTHER_LOCATION_STR, file, line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ void QPlainTestLogger::printMessage(MessageSource source, const char *type, cons
|
|||||||
QTestCharBuffer testIdentifier;
|
QTestCharBuffer testIdentifier;
|
||||||
QTestPrivate::generateTestIdentifier(&testIdentifier);
|
QTestPrivate::generateTestIdentifier(&testIdentifier);
|
||||||
QTest::qt_asprintf(&messagePrefix, "%s: %s%s%s%s\n",
|
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.
|
// In colored mode, printf above stripped our nonprintable control characters.
|
||||||
// Put them back.
|
// Put them back.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user