From b2912174572dea2a7bff59414418d602ef58a00a Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 24 Jan 2023 12:21:17 +0200 Subject: 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 --- tests/auto/corelib/text/qstring/tst_qstring.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'tests') 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; -- cgit v1.2.3