diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2014-08-27 12:34:42 +0200 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@edeltech.ch> | 2014-08-27 15:37:51 +0200 |
commit | a8a8a3bfbd4539e242360bc8a561390bbf9615f7 (patch) | |
tree | 0835a2ad37932a8307384c3d17d282bf4d1ed6ef /tests/auto/corelib/tools/qstring/tst_qstring.cpp | |
parent | 23a2ad6f61ce237ea21e960726d2f92c84d200fc (diff) |
tst_QString: Use a non-empty string for lastIndexOfInvalidRegex
Testing using an empty string doesn't ensure that the regexp
gets validated. The function may return earlier thus making
the test useless. This patch adds a text to search in so that
no early optimization avoids the regexp validation part
Change-Id: If24b77385dde44a922d43e5ae1d7a5393d24f640
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tests/auto/corelib/tools/qstring/tst_qstring.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qstring/tst_qstring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index f8dab9fb08..7644c7523f 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -1418,7 +1418,7 @@ void tst_QString::lastIndexOf() void tst_QString::lastIndexOfInvalidRegex() { QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object"); - QCOMPARE(QString("").lastIndexOf(QRegularExpression("invalid regex\\"), 0), -1); + QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), 0), -1); } void tst_QString::count() |