diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index aec7b986a94..ce10b0a8eb1 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2064,12 +2064,16 @@ bool QTest::qExpectFail(const char *dataIndex, const char *comment, 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) { QTestLog::warn(message, file, line); } +#endif /*! 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()) { - QTest::qWarn(qPrintable( + QTestLog::warn(qPrintable( QString::fromLatin1("testdata %1 could not be located!").arg(base)), file, line); } else if (QTestLog::verboseLevel() >= 1) { diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 55419551fa9..1541afc0846 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -311,7 +311,10 @@ namespace QTest 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, 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); +#endif Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message); #if QT_CONFIG(regularexpression) Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern); @@ -573,18 +576,7 @@ namespace QTest #undef QTEST_COMPARE_DECL -#if QT_DEPRECATED_SINCE(6, 2) -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(msg), __FILE__, __LINE__) +#define QWARN(msg) QTest::qWarn(static_cast(msg), __FILE__, __LINE__) QT_END_NAMESPACE