diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2020-10-13 16:52:10 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2020-10-21 17:56:48 +0200 |
commit | a17e05bf20e33c66ca76fd832b6c70c45b9424de (patch) | |
tree | 58f058e3e04f37cbb5ddc3147bbaa9d214406cc3 /tests/auto | |
parent | e69b81101c6e09d1c1b81d50ea868a8625c9f248 (diff) |
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 <assam.boudjelthia@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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")); } |