diff options
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 9 | ||||
-rw-r--r-- | src/corelib/text/qstringlist.cpp | 2 | ||||
-rw-r--r-- | src/testlib/qtestlog.cpp | 8 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index d518a2f28f2..3e27f0260d3 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -1889,6 +1889,15 @@ QByteArray::QByteArray(qsizetype size, Qt::Initialization) } /*! + \fn QByteArray::QByteArray(QByteArrayView v) + \since 6.8 + + Constructs a byte array initialized with the byte array view's data. + + The QByteArray will be null if and only if \a v is null. +*/ + +/*! Sets the size of the byte array to \a size bytes. If \a size is greater than the current size, the byte array is diff --git a/src/corelib/text/qstringlist.cpp b/src/corelib/text/qstringlist.cpp index bb9cf2f0c9f..e6f85849f27 100644 --- a/src/corelib/text/qstringlist.cpp +++ b/src/corelib/text/qstringlist.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE \reentrant - QStringList inherits from QList<QString>. Like QList, QStringList is + QStringList is actually just a QList<QString>. Like QList, QStringList is \l{implicitly shared}. It provides fast index-based access as well as fast insertions and removals. Passing string lists as value parameters is both fast and safe. diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 8a94aa0e19f..f41242f357d 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -193,6 +193,7 @@ namespace QTest { if (const auto *regex = get_if<QRegularExpression>(&pattern)) return regex->match(message).hasMatch(); #endif + Q_ASSERT(pattern.metaType() == QMetaType::fromType<QString>()); return stringsMatch(pattern.toString(), message); } @@ -265,6 +266,9 @@ namespace QTest { if (!message.contains(*regex)) continue; #endif + } else { + // The no-arg clearFailOnWarnings()'s null pattern matches all messages. + Q_ASSERT(pattern.isNull()); } const size_t maxMsgLen = 1024; @@ -402,6 +406,10 @@ void QTestLog::printUnhandledIgnoreMessages() } else if (const auto *regex = get_if<QRegularExpression>(&list->pattern)) { message = "Did not receive any message matching: \"%1\""_L1.arg(regex->pattern()); #endif + } else { + Q_UNREACHABLE(); + message = "Missing message of unrecognized pattern type: \"%1\""_L1.arg( + list->pattern.metaType().name()); } for (auto &logger : QTest::loggers->allLoggers()) logger->addMessage(QAbstractTestLogger::Info, message); |