From a17e05bf20e33c66ca76fd832b6c70c45b9424de Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Tue, 13 Oct 2020 16:52:10 +0200 Subject: Fix strange capacity check in tst_QString::append_special_cases We cannot rely on "QString a; a.insert(0, u'A');" to give a.capacity() >= 3, this is clearly an implementation detail. Changed the check to a meaningful one Task-number: QTBUG-87416 Change-Id: I2e017c1292d360e32b85b903361027485c08ea74 Reviewed-by: Assam Boudjelthia Reviewed-by: Thiago Macieira --- tests/auto/corelib/text/qstring/tst_qstring.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index e63270bfe4..29d794490b 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -2467,7 +2467,8 @@ void tst_QString::append_special_cases() { QString a; a.insert(0, QChar(u'A')); - QVERIFY(a.capacity() >= 3); + QCOMPARE(a.size(), 1); + QVERIFY(a.capacity() > 0); a.append(QLatin1String("BC")); QCOMPARE(a, QLatin1String("ABC")); } -- cgit v1.2.3