diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-01-24 12:21:17 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-02-02 15:57:18 +0200 |
commit | b2912174572dea2a7bff59414418d602ef58a00a (patch) | |
tree | cacb441da005493df6ef7789d74db13dc2b0238d /tests | |
parent | 9a1b7c7fa59a5033344dd0b67b28de3531c92d69 (diff) |
QString: remove some redundant unittests
The QChar::toLatin1() args in:
str.replace(index, len, QChar(after[0]).toLatin1())
s2.replace(ch.toLatin1(), after, cs)
will be converted to QChar, so it's always calling the same QString
overload, I argue that we're not testing QChar implicit conversions
here.
Change-Id: I3962cab2b34684f970638575e6bd15dd1067a8c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index fbbb4377f4..4e618eb697 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -3416,10 +3416,6 @@ void tst_QString::replace_uint_uint() QString s3 = string; s3.replace( (uint) index, (uint) len, QChar(after[0]) ); QTEST( s3, "result" ); - - QString s4 = string; - s4.replace( (uint) index, (uint) len, QChar(after[0]).toLatin1() ); - QTEST( s4, "result" ); } } @@ -3555,14 +3551,6 @@ void tst_QString::replace_string() s4.begin(); // Test when isShared() is false s4.replace(ch, after, cs); QCOMPARE(s4, result); - - // What is this one testing? it calls the same replace() overload - // as the previous two - if ( QChar(ch.toLatin1()) == ch ) { - QString s2 = string; - s2.replace( ch.toLatin1(), after, cs ); - QCOMPARE(s2, result); - } } QString s3 = string; |