diff options
author | Giuseppe D'Angelo <dangelog@gmail.com> | 2012-02-23 02:49:52 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-07 00:02:39 +0100 |
commit | 6b7898059386fe48d9de55d68f1f3f330ce8fb0a (patch) | |
tree | 7bf4df685b9065146ea5d7544814d7fa31e788e1 /tests/auto/corelib/tools/qregularexpression | |
parent | c74bc26605f2337b13f366c2600fff4822d88ffe (diff) |
QRegularExpression: fix autotest
Some minor fixes: obviously, a valid match always come from a
valid regular expression, but a valid regular expression can create
an invalid match (internal error during matching).
Also, testing an invalid iterator should silence the emitted
warnings.
Change-Id: I585bb99a81e22f108601fd66bf30b56e0229d68b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qregularexpression')
-rw-r--r-- | tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp index 9430425532..238d8626c3 100644 --- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp @@ -191,9 +191,8 @@ bool operator!=(const QList<Match> &expectedMatchList, const QRegularExpressionM void consistencyCheck(const QRegularExpressionMatch &match) { - QVERIFY(match.isValid() == match.regularExpression().isValid()); - if (match.isValid()) { + QVERIFY(match.regularExpression().isValid()); QVERIFY(!(match.hasMatch() && match.hasPartialMatch())); if (match.hasMatch() || match.hasPartialMatch()) { @@ -260,7 +259,9 @@ void consistencyCheck(const QRegularExpressionMatchIterator &iterator) } } else { QVERIFY(!i.hasNext()); + QTest::ignoreMessage(QtWarningMsg, "QRegularExpressionMatchIterator::peekNext() called on an iterator already at end"); QRegularExpressionMatch peeked = i.peekNext(); + QTest::ignoreMessage(QtWarningMsg, "QRegularExpressionMatchIterator::next() called on an iterator already at end"); QRegularExpressionMatch match = i.next(); consistencyCheck(peeked); consistencyCheck(match); |