Deprecate QTest::qWarn() and replace its last use
The one place that actually called it with file and line number was internal to QtTest, so could call QtTestLog::warn(). Change-Id: I8be10fc81996cc3de4d2eea3ecedc59671ffe759 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
5b525e8e54
commit
78c8f0cd4d
@ -2064,12 +2064,16 @@ bool QTest::qExpectFail(const char *dataIndex, const char *comment,
|
|||||||
return QTestResult::expectFail(dataIndex, qstrdup(comment), mode, file, line);
|
return QTestResult::expectFail(dataIndex, qstrdup(comment), mode, file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \internal
|
#if QT_DEPRECATED_SINCE(6, 3)
|
||||||
|
/*!
|
||||||
|
\internal
|
||||||
|
\deprecated [6.3] Use qWarning() instead
|
||||||
*/
|
*/
|
||||||
void QTest::qWarn(const char *message, const char *file, int line)
|
void QTest::qWarn(const char *message, const char *file, int line)
|
||||||
{
|
{
|
||||||
QTestLog::warn(message, file, line);
|
QTestLog::warn(message, file, line);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Ignores messages created by qDebug(), qInfo() or qWarning(). If the \a message
|
Ignores messages created by qDebug(), qInfo() or qWarning(). If the \a message
|
||||||
@ -2315,7 +2319,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
|
|||||||
|
|
||||||
|
|
||||||
if (found.isEmpty()) {
|
if (found.isEmpty()) {
|
||||||
QTest::qWarn(qPrintable(
|
QTestLog::warn(qPrintable(
|
||||||
QString::fromLatin1("testdata %1 could not be located!").arg(base)),
|
QString::fromLatin1("testdata %1 could not be located!").arg(base)),
|
||||||
file, line);
|
file, line);
|
||||||
} else if (QTestLog::verboseLevel() >= 1) {
|
} else if (QTestLog::verboseLevel() >= 1) {
|
||||||
|
@ -311,7 +311,10 @@ namespace QTest
|
|||||||
Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line);
|
Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line);
|
||||||
Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode,
|
Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode,
|
||||||
const char *file, int line);
|
const char *file, int line);
|
||||||
|
#if QT_DEPRECATED_SINCE(6, 3)
|
||||||
|
QT_DEPRECATED_VERSION_X_6_3("Use qWarning() instead")
|
||||||
Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = nullptr, int line = 0);
|
Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = nullptr, int line = 0);
|
||||||
|
#endif
|
||||||
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message);
|
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message);
|
||||||
#if QT_CONFIG(regularexpression)
|
#if QT_CONFIG(regularexpression)
|
||||||
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
|
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
|
||||||
@ -573,18 +576,7 @@ namespace QTest
|
|||||||
|
|
||||||
#undef QTEST_COMPARE_DECL
|
#undef QTEST_COMPARE_DECL
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6, 2)
|
#define QWARN(msg) QTest::qWarn(static_cast<const char *>(msg), __FILE__, __LINE__)
|
||||||
namespace QTestPrivate {
|
|
||||||
QT_DEPRECATED_VERSION_X_6_2("Use qWarning() instead")
|
|
||||||
Q_DECL_UNUSED static inline void qWarnMacro(const char *message, const char *file = nullptr, int line = 0)
|
|
||||||
{
|
|
||||||
QTest::qWarn(message, file, line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QWARN(msg) \
|
|
||||||
QTestPrivate::qWarnMacro(static_cast<const char *>(msg), __FILE__, __LINE__)
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user