summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2009-04-15 08:30:17 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2009-04-15 08:51:34 (GMT)
commitafb3848e0abe0cd2355e7ee7319fd904288e4636 (patch)
treece3e4388865e4f71d15e39a1f8c9c8c90bfc1101 /tests/auto/qstring/tst_qstring.cpp
parent34ae1f3021147062e669747c4023051ed38c72aa (diff)
downloadQt-afb3848e0abe0cd2355e7ee7319fd904288e4636.zip
Qt-afb3848e0abe0cd2355e7ee7319fd904288e4636.tar.gz
Qt-afb3848e0abe0cd2355e7ee7319fd904288e4636.tar.bz2
Fix regression in QString::replace(int, int, QChar) when string is empty
When QString::replace was optimized, this specific overload missed out on sanity checking of the arguments. Task-number: 249517 Reviewed-by: Joao Reviewed-by: hjk BT: yes
Diffstat (limited to 'tests/auto/qstring/tst_qstring.cpp')
-rw-r--r--tests/auto/qstring/tst_qstring.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp
index f786965..1263a41 100644
--- a/tests/auto/qstring/tst_qstring.cpp
+++ b/tests/auto/qstring/tst_qstring.cpp
@@ -432,6 +432,10 @@ void tst_QString::replace_uint_uint_data()
QTest::newRow( "rep09" ) << QString("ACABCAB") << 4 << 2 << QString("XX") << QString("ACABXXB");
QTest::newRow( "rep10" ) << QString("ACABCAB") << 5 << 2 << QString("XX") << QString("ACABCXX");
QTest::newRow( "rep10" ) << QString("ACABCAB") << 6 << 2 << QString("XX") << QString("ACABCAXX");
+ QTest::newRow( "rep12" ) << QString() << 0 << 10 << QString("X") << QString("X");
+ QTest::newRow( "rep13" ) << QString("short") << 0 << 10 << QString("X") << QString("X");
+ QTest::newRow( "rep14" ) << QString() << 0 << 10 << QString("XX") << QString("XX");
+ QTest::newRow( "rep15" ) << QString("short") << 0 << 10 << QString("XX") << QString("XX");
}
void tst_QString::replace_string_data()