Fix QT_NO_REGULAREXPRESSION build
Change-Id: Ibf1358733d7c5aa2c14cf46c23a24ba4da14143c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
bf9a4ef8b4
commit
10b9e1b6b4
@ -43,6 +43,8 @@
|
||||
|
||||
#include "qregularexpression.h"
|
||||
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
#include <QtCore/qmutex.h>
|
||||
#include <QtCore/qvector.h>
|
||||
@ -2495,3 +2497,5 @@ static const char *pcreCompileErrorCodes[] =
|
||||
#endif // #if 0
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_REGULAREXPRESSION
|
||||
|
@ -2617,10 +2617,12 @@ void QTest::ignoreMessage(QtMsgType type, const char *message)
|
||||
\since 5.3
|
||||
*/
|
||||
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
void QTest::ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern)
|
||||
{
|
||||
QTestLog::ignoreMessage(type, messagePattern);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*! \internal
|
||||
*/
|
||||
|
@ -248,7 +248,9 @@ namespace QTest
|
||||
const char *file, int line);
|
||||
Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = 0, int line = 0);
|
||||
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message);
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
|
||||
#endif
|
||||
|
||||
Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = 0, int line = 0, const char* builddir = 0);
|
||||
Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = 0, int line = 0, const char* builddir = 0);
|
||||
|
@ -133,7 +133,11 @@ namespace QTest {
|
||||
return tp == type
|
||||
&& (pattern.type() == QVariant::String ?
|
||||
stringsMatch(pattern.toString(), message) :
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
pattern.toRegularExpression().match(message).hasMatch());
|
||||
#else
|
||||
false);
|
||||
#endif
|
||||
}
|
||||
|
||||
QtMsgType type;
|
||||
@ -359,7 +363,9 @@ void QTestLog::printUnhandledIgnoreMessages()
|
||||
if (list->pattern.type() == QVariant::String) {
|
||||
message = QStringLiteral("Did not receive message: \"") + list->pattern.toString() + QLatin1Char('"');
|
||||
} else {
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
message = QStringLiteral("Did not receive any message matching: \"") + list->pattern.toRegularExpression().pattern() + QLatin1Char('"');
|
||||
#endif
|
||||
}
|
||||
QTest::TestLoggers::addMessage(QAbstractTestLogger::Info, message);
|
||||
|
||||
@ -512,12 +518,14 @@ void QTestLog::ignoreMessage(QtMsgType type, const char *msg)
|
||||
QTest::IgnoreResultList::append(QTest::ignoreResultList, type, QString::fromLocal8Bit(msg));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
void QTestLog::ignoreMessage(QtMsgType type, const QRegularExpression &expression)
|
||||
{
|
||||
QTEST_ASSERT(expression.isValid());
|
||||
|
||||
QTest::IgnoreResultList::append(QTest::ignoreResultList, type, QVariant(expression));
|
||||
}
|
||||
#endif
|
||||
|
||||
void QTestLog::setMaxWarnings(int m)
|
||||
{
|
||||
|
@ -76,7 +76,9 @@ public:
|
||||
static void addBenchmarkResult(const QBenchmarkResult &result);
|
||||
|
||||
static void ignoreMessage(QtMsgType type, const char *msg);
|
||||
#ifndef QT_NO_REGULAREXPRESSION
|
||||
static void ignoreMessage(QtMsgType type, const QRegularExpression &expression);
|
||||
#endif
|
||||
static int unhandledIgnoreMessages();
|
||||
static void printUnhandledIgnoreMessages();
|
||||
static void clearIgnoreMessages();
|
||||
|
Loading…
Reference in New Issue
Block a user